up vote 6 down vote favorite
3
share [g+] share [fb]

How do I replace the string "\r\n" with the same characters. Example:

Hello World.\r\nHello World.

replaced with:

Hello World.
Hello World.
link|improve this question

66% accept rate
feedback

3 Answers

up vote 15 down vote accepted

Press CTRL-h and the Replace dialog will open. Type "\\r\\n" in "Find what" and "\r\n" in "Replace with". Finally, select the extended search mode and click "Replace All".

link|improve this answer
feedback

In the find screen, on the replace tab choose extended search.
In the find text box put "\\r\\n", and in the replace text box put "\r\n".

link|improve this answer
Does this actually work, or do you need to do escaping? – joshhunt Sep 17 '09 at 14:21
I had escaping, but I had to double escape it for it to show up right here (ie \\\\r\\\\n instead of \\r\\n). – C. Ross Sep 17 '09 at 14:55
So did you just now have to quadruple escape that in the comment? ^^^^^^^ – hyperslug Sep 17 '09 at 15:31
No thankfully it doesn't try to interpret comments ... – C. Ross Sep 18 '09 at 14:55
feedback

Copy a newline and use the Search and Replace function to replace \r\n with the newline. The newline character will show up as an empty box.

link|improve this answer
I couldn't get this to work earlier. – C. Ross Sep 17 '09 at 14:56
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.