In this article, I will describe how to insert a line break after a comma and remove spaces before the text in new lines using Notepad++.
Notepad++ Download
- Open Notepad++ and load the file in which you need to replace commas with line breaks.
- Go to the Search menu and select Replace.
- In the opened window, find the Find field and enter a comma:
,
In the Replace with field, enter the line break symbol. Use the special character:
,\n
.
Click the Replace All button to replace all commas in the text with line breaks.
Note that after the line break, there is a space before the text in the new lines. If you need to remove it, use the second instruction below.
Removing space before the line
- Go to the Search menu and select Replace.
- In the opened search window, enter the regular expression:
,\s*
In the Replace with field, enter the following regular expression:
,\n
Click the Replace All button.
Now you know how to insert line breaks after a comma, with or without removing the space.