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

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!

This entry was posted in Uncategorized. Bookmark the permalink.

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

  1. Max says:

    This really helped me out. Thanks a lot!

  2. Yemi says:

    Thanks for this!! Really helpful!

  3. Jem says:

    Thanks a lot! It works fantastic.

    jem

  4. siddhant says:

    nice work…

  5. Lakshman says:

    Thanks for your help. It really works.

  6. Kenneth says:

    Nice, helped me a lot. Thanks!

  7. thanks says:

    thanks

  8. Midas says:

    Thanks!

  9. Raphi says:

    Very handy tip. and exactly what I was looking for. Thanks

  10. Chromsome24 says:

    Ahhh… Thanks for the help..

  11. kalyani says:

    Nice!! It helps

  12. tek says:

    Hello!

    Do you have any idea why this does not work?
    I think, basically the “extended” function is not in my case now. I have used this for 7 years and now it just simply puts /n everywhere.

    If you have any idea, please, help me.

    Thanks,
    tek

  13. Kanthu says:

    This is giving what exactly I want. Nice.. :)

  14. aliaa says:

    Very helpful :)

  15. Sharad says:

    It saved me a lot of work.. Thanks..

  16. minh says:

    very helpful, thanks :)

  17. God says:

    I as God, blessed you

  18. Prado says:

    Cool!
    Just saved me a lot of hand work :-)
    Thanks!

  19. Sesha says:

    Very Helpful, Thanks !!!

  20. Joe says:

    Awesome! I just read at least 4 or 5 other links but none mentioned that you have to search on double \\ and yours was the only correct reference. Thank you!!!!

  21. Keshav says:

    Thank you very much. Saved me writing a program to do it :)

  22. Joshua H says:

    If I could kiss you I would :)

  23. kedare says:

    Thanks :)

  24. Sujata says:

    Very helpful….Thanks!!!!

  25. Mahesh kohinkar says:

    thanks that works..

  26. HTS says:

    Thank you. This is exactly what I needed.

    I’m surprised Notepad++ doesn’t have a simple command to do this.

  27. Kektklik says:

    Thanks a ton. This will make reading a game’s Manifest.json file a lot easier.. when it finishes inserting 500+ lines.

  28. vicky says:

    thx a lot

  29. Andrew says:

    Great tutorial. I needed to sort this thing out for a database of over 100k, and it worked perfectly. Thank you so much :)

    Regards,
    Andrew

  30. Biswajeet says:

    Is there any way we can do opposite operation,
    Consider every line ends with EOL

    Can we use EOL\n to replace with EOL, so all the new line can be removed

  31. rajum says:

    nice very help full to me. thanks mate.

  32. Darlene says:

    Thank you so mush, very helpfull :)

  33. Vamsi says:

    nice very help ful to me. thanks

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>