SQL Developer: How to enter new line character in Find & Replace?

How do you enter a new line character in using SQL Developer's > Find & Replace ?  For example,  I want to find "ABCD" and replace it with:

       AB               <-- new line character
       CD.

I've tried regex's, "\n", and a few other things but no luck. Anyone know the magic character(s)?
LVL 53
_agx_Asked:
Who is Participating?
 
Raheman M. AbdulSenior Infrastructure Support Analyst & Systems DeveloperCommented:
screenshotFollow the screenshot.
I tried to find Timestamp and replace with Time \n Stamp which results as:
Time
Stamp
(see screenshot). You need to tick Use and select "Regular expressions"
0
 
slightwv (䄆 Netminder) Commented:
If it is 4 characters you want split 2x2:

substr:
with mydata as (
select 'ABCD' mystr from dual
)
select substr(mystr,1,2) || chr(10) || substr(mystr,-2,2) from mydata
/


regexp_replace:
select regexp_replace('ABCD','([A-Z]{2})([A-Z]{2})','\1' || chr(10) || '\2') from dual;
0
 
slightwv (䄆 Netminder) Commented:
Sorry. I missed the 'Find and Replace'.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
_agx_Author Commented:
@slightwv - No worries.

@Raheman Mohammed Abdul - Thanks, I'm actually using Oracle's SQL Developer, rather than SSMS, but ... that's a good idea. Let me give it a whirl...
0
 
_agx_Author Commented:
I'm still curious about how to do this in SQL Developer, but as I have SSMS too this did exactly what I needed. Thanks for kick-starting my brain ;-)
0
 
sdstuberCommented:
Using SQL Developer 4.0  a simple Ctrl-F  search and replace worked just fine for me  to embed new lines into my text


Ctrl-F   search and replace
0
 
Raheman M. AbdulSenior Infrastructure Support Analyst & Systems DeveloperCommented:
Thanks _agx_
0
 
_agx_Author Commented:
@Raheman Mohammed Abdul - Thanks again for your help.  If it's okay with everyone, I'd like to reopen this thread and split the points.  I didn't see sdstuber's response until later, and it was also helpful.  It led me to figuring out how to make it work in SQL Developer too. Now I have too good options :)

@sdstuber - Your response made me take another look at it. I'm using 4.0.2 so the my options are slightly different. In addition to the options you mentioned, I also checked the one below. Then it worked perfectly. Thanks!


When replacing:

[x] Substitute Escaped characters
0
 
Raheman M. AbdulSenior Infrastructure Support Analyst & Systems DeveloperCommented:
just send message to admin to reopen this and split points whatever you wish to.
0
 
_agx_Author Commented:
Thanks for the help everyone. Much appreciated.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.