Editor: Search and replace TRIM function

MartinSv

Member²
Hello

I have a lot of SQL commands containing TRIM() functions. I would like to replace all occurrences of TRIM(Table.Field) with NVL(TRIM(Table.Field), ' ').
Is it possible in PL/SQL Developer? Or any other tool? Some regular expression replace?
Thanks for tip.
 
Notepad++ would allow you to do it.

search for "trim(.*)"
replace with "nvl(trim\1,' ')"

turns this - trim(this.field)
into this - nvl(trim(this.field),' ')
 
Sorry, I didn't think of that!

do a find on "trim(./)", then do a ctl-home.

start recording a macro, press the Find Next (defaults to ctl-l if I remember). Now you have the first trim highlighted. Do ctl-x to put it into the clipboard, type "nvl(", ctl-v, ", ' ')" and stop the macro recording.

Now press f12 repeatedly.

Marco, when is regex going to be upgraded to handle this?
 
Back
Top