Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

How do I replace the string "\r\n" with the same characters?

Example:

Hello World.\r\nHello World.

replaced with:

Hello World.
Hello World.
share|improve this question
add comment

3 Answers 3

up vote 37 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".

share|improve this answer
    
works in Programmer's notepad as well. Select "Allow backslash expressions" and do the same –  Peter Munnings Jul 3 '12 at 19:05
    
Does that work in newer versions of Notepad++? Or does it require selecting the option "Extended (\n, \r, \t, \0, \x)"? –  Peter Mortensen Feb 15 at 19:14
    
Search mode has to be "Extended" to work. –  Marcel Mar 19 at 16:06
    
This also works in notepad2 in case anyone is interested. Check regular expression search when replacing –  Hoppe Mar 31 at 16:39
add comment

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.

share|improve this answer
    
Does this actually work, or do you need to do escaping? –  David Pearce 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
add comment

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.

share|improve this answer
1  
I couldn't get this to work earlier. –  C. Ross Sep 17 '09 at 14:56
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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