قالب وردپرس درنا توس
Home / Tips and Tricks / How to replace every character with newlines in Notepad ++

How to replace every character with newlines in Notepad ++



Convert a comma separated list in Notepad ++

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”

;), you can put each item in the list on a new line.

To do this, download the free app Notepad ++ and install it on your computer. Then launch the app from the Start menu.

Start Notepad ++ from the Windows 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.

A Notepad ++ window with a comma separated list.

Then click on the “Search” menu and select “Replace”. Alternatively, you can press Ctrl + H on your keyboard.

Select Search> Replace in Notepad ++.  “Width =” 650 “height =” 407 “onload =” pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon (this);  “onerror =” this.onerror = null;  pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon (this);  “/></p><div><script async src=

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:

n

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.

In the

And just like magic, each item in your list is now on a separate line.

A line separated list in Notepad ++.

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.

Another newline delimited item list in Notepad ++.

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.

In the

After that you will see that all your items are now on one line, separated by a space.

A list of items on one line in Notepad ++.

To turn this into a comma separated list using Notepad ++, click Search> Replace in the menu.

Select Search> Replace in Notepad ++.  “Width =” 650 “height =” 419 “onload =” pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon (this);  “onerror =” this.onerror = null;  pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon (this);  “/></p><div><script async src=

In the “Replace” window, click the “Search for” box and press the spacebar. Then place your cursor in “Replace With” and type the character you want to replace the space with, such as comma (“,”) or a command and a space for human readable format.

When you are done, click “Replace All” on the right.

In the

Your list items are now separated by the new separator you chose.

A comma separated item list in Notepad ++.

Repeat this as many times as you want, and you will have all your lists in perfect condition in no time.

By the way, if you don’t like Notepad ++, you can also find and replace text with Microsoft Word. With that option you can search for any character and convert it to the character of your choice.

RELATED: Find and replace text in Microsoft Word




Source link