Replace "\n" with new line characters, using Notepad++

July 5th, 2011
In case you have a file which contains "escaped" new lines (\n), like this:

notepad-1.PNG



and you want to replace the escaped new line sequences with actual new line characters, you can easily accomplish this task using Notepad++.

First load your file (or just copy paste the text) in Notepad++.

notepad-2.PNG



Then select Search → Replace from the menu, or hit Ctrl-H. The Replace dialog will show up. Therein make sure that you fill out the following values; Find what: \\n (yes, two back-slashes), Replace with: \n (yes, just one back-slash), and the most important, make sure you select the Extended (\n, \r, \t, \0, \x, ...) radio button. Your Replace dialog must look like this:

replace-1.PNG



Click the Replace All button, and all escaped new line sequences will be replaced with new line characters:

notepad-3.PNG



I hope this helped!

One Response to “Replace "\n" with new line characters, using Notepad++”

  1. Max Says:
    This really helped me out. Thanks a lot!

Leave a Reply