Notepad++: Remove new line and add comma

In Notepad Plus Plus, when you have a list of strings and you want to have one line with these strings separated by a comma, you can use the Replace function.

Let’s assume you have this list

Apple
Orange
Strawberry
Banana
Kiwi

and you want this outcome:

Apple, Orange, Strawberry, Banana, Kiwi

Then do this: CTRL + H to open the Replace window. Then select Regular Expression in Search Mode. In the Find What, enter [\r\n]+. Then in the Replace with, enter the comma (,) and maybe followed by a space if you also want to add that.

 

Author Bio

Thank you for your interest in my blog! On this miniblog, I write mostly short (technical) blog posts that might interest other people. Read more about me or feel free to contact me.

 

One thought on “Notepad++: Remove new line and add comma

Leave a Reply

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