If you have a list of values in a text file separated by a character (such as a comma or pipe), but you prefer to have each item on its own line, you can automatically convert the new line to Notepad ++. Here’s how.
Convert any character to a new line with Notepad ++
Notepad ++ includes a function to replace any separator in your text files with a newline character, a special invisible character that indicates the end of a line and the start of a new line. So, for example, if you have a comma-separated list (for example, “Windows, iPhone, Mac, Android”
To do this, download the free app Notepad ++ and install it on your computer. Then launch the app from the Start menu.
In the Notepad ++ window, open the text file containing the list you want to convert. Alternatively, you can paste your item list on a line.
Then click on the “Search” menu and select “Replace”. Alternatively, you can press Ctrl + H on your keyboard.
In the Replace window that opens, click the “Search for” text input box and type the current item separator. In our example, our items are separated by a comma and a space, so we’ll type a comma and then press the space bar. If your items are only separated by tubes, type the character for a tube (“|”).
Type this in the “Replace with” box:
Then find the ‘Search Mode’ box and select ‘Advanced’. This allows the replace action ” n” to convert to a newline character. Then click on “Replace All” on the right side of the window.
And just like magic, each item in your list is now on a separate line.
If you want to reverse the process, just open Search> Replace in the menu again. In the “Search for” box, enter ” n”. In the Replace with box, type the character you want to replace it with. Make sure “Advanced” is selected and click “Replace All”, and your list will be separated again by a standard character, such as a comma or a pipe.
How to convert a Newline character to another separator
Likewise, you can also replace the newline character with another separator using the same method described above in Notepad ++. (There are only a few minor differences in the process due to the different ways different platforms deal with new rules.)
To do this, open Notepad ++ and the text file you want to convert or paste your item list into.
In your Notepad ++ window, click the “Edit” menu and select Empty Edits> EOL to Spacebar. Here EOL means “End of line”, and this option converts the invisible characters for a newline to spaces.
After that you will see that all your items are now on one line, separated by a space.
To turn this into a comma separated list using Notepad ++, click Search> Replace in the menu.