Replace new lines with a comma delimiter with Notepad++?
notepad++
Solution
Open the find and replace dialog (press CTRL+H).
Then select `Regular expression` in the 'Search Mode' section at the bottom.
In the `Find what` field enter this: `[\r\n]+`
In the `Replace with`: `, `
There is a space after the comma.
This will also replace lines like
Apples
Apricots
Pear
Avocados
Bananas
Where there are empty lines.
If your lines have trailing blank spaces you should remove those first. The simplest way to achieve this is
EDIT -> Blank Operations -> Trim Trailing Space
OR
TextFX -> TextFX Edit -> Trim trailing spaces
Be sure to set the Search Mode to "Regular expression".
Problem
I have a Notepad++ question. How can I take the below words in Notepad++ (which is on different lines) ``` Apples Apricots Pear Avocados Bananas ``` And turn them into a paragraph with a comma at the end of each one? Like this: ``` Apples, Apricots, Pear, Avocados, Bananas ```