Would anyone mind sharing some useful PasteOptions.ini configs?

Tim Scott

Member²
Hi,

I'll happily re-share mine back when I've re-written them following my hard drive crash, but I thought that in the meantime there might be others who have written or are looking for the same things. I know I had:-

- Remove quotes, i.e.: 'A Quot''d String' -> A Quot'd String
- Add quotes safe for sqlplus: the reverse of the above, plus ensuring that lines don't end with ';' and are not completely blank
- Convert line-by-line to quoted list

I had some proprietary ones, too. but those struck me as generically useful.

Thanks,
Tim
 
Hi,

thats indeed curios. I posted my file, but after submit there were only few lines visible. So I deleted my post immediatly.

Then I tried the email feature, but there I didn't see succesfull sending.
But you have got it ;-)

HTH
 
Actually - I got 3 emails with extremely similar content. I wonder what would happen if I tried to post it:

Code:
// InPaste: will convert a column of values copied from a Colum in the Query-Result-Window to values enclosed in single quotes and separated by commas, heading 'IN (' and trailing ')'
// 1)  Strip all control chars and spaces
// 2)  Replace all CR\LF with ','
// 3)  Add ' to the beginning of each line.
// 4)  Add ' to the end of each line.
// 5)  Add IN ( to the beginning
// 6)  Add ) to the end

InPaste	strip
InPaste	replace	/#13//#10/	','
InPaste	beginlines	'
InPaste	endlines	'
InPaste	begin	IN (
InPaste	end	)

// InPasteNumbers: will convert a column of values copied from a Colum in the Query-Result-Window to values and separated by commas, heading 'IN (' and trailing ')'
// 1)  Strip all control chars and spaces
// 2)  Replace all CR\LF with ,
// 3)  Delete all triple dots
// 4)  Add IN ( to the beginning
// 5)  Add ) to the end

InPasteNumbers	strip
InPasteNumbers	replace	/#13//#10/	,
InPasteNumbers	replace	.	
InPasteNumbers	begin	IN (
InPasteNumbers	end	)

// AliasPaste: will convert a column of values copied comma-separated from a Colum in the Describe-Window  to values heading each with alias.
// 1)  Strip all control chars and spaces

AliasPaste	strip
AliasPaste	beginlines	alias.

(edited to remove unicode single quotes on the InPaste replace comment)
 
Last edited:
So I've re-installed and I've put together one of my PasteOptions things:

Code:
// Safe4SQLPlus: Makes a piece of text safe for a quoted string in a SQL*Plus script

Safe4SQLPlus	replace	'	''
Safe4SQLPlus	begin	'
Safe4SQLPlus	replace	;/#13//#10/	;'||'/#13//#10/
Safe4SQLPlus	replace	/#13//#10//#13//#10/	/#13//#10/'||'/#13//#10/
Safe4SQLPlus	end	'

.. but I can't remember how I did the reverse of that. I've got, thus far:

Code:
Quote2Actual	replace	;'||'/#13//#10/	;/#13//#10/
Quote2Actual	replace	/#13//#10/'||'/#13//#10/	/#13//#10//#13//#10/
Quote2Actual	replace	''	'

.. but that doesn't remove the ' from the beginning end end. I guess one could always not copy that : but I'm sure I did.
 
I remembered how to remedy the "remove from start" and "remove from end", so here's an updated Quote2Actual:

Code:
Quote2Actual	begin	/#01/
Quote2Actual	end	/#01/
Quote2Actual	replace	/#01/'
Quote2Actual	replace	'/#01/
Quote2Actual	replace	;'||'/#13//#10/	;/#13//#10/
Quote2Actual	replace	/#13//#10/'||'/#13//#10/	/#13//#10//#13//#10/
Quote2Actual	replace	''	'

.. the trick being to add a character at the start and end that won't appear in the string itself and then remove that marker + what you actually wanted to remove.
 
Back
Top