Replace “\n” with new line characters, using Notepad++

Due bad formatting you will encounter the below scenario in your day to day work. You may want this file to convert to
Excel/CSV.

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

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

First of all, you want to convert the escaped newline character to real “\n”. You can easily do this via using Notepad++(a free source code editor which supports several programming languages running under the MS Windows environment.).

Step 1

Load your file in the Notepad++ or copy/paste the content to Notepad++ new file.

Replace  with new line characters, using Notepad++

Step 2

Select the Select -> Replace from the menu or hit Ctrl+H, to appear the replace dialogue. Fill out your values as per the below picture.  Most importantly make sure you select Extended(\n,\r,\t..) radio button in Search Mode.

Replace with new line characters, using Notepad++

Click the Replace All button, and all the escaped newline characters will be replaced with an original newline character.  And you will see that instead of a single line, it will be coming in one column. To convert to CSV you can just rename the extension of the file to .csv in my case images.csv.

Hope this helps.

Editorial Staff
 

Editorial Staff at tutsplanet is a dedicated team to write various tutorial articles.