How to break lines at a specific character in Notepad++?
- Click Ctrl + h or Search -> Replace on the top menu
- Under the Search Mode group, select Regular expression
- In the Find what text field, type
],\s*
- In the Replace with text field, type
],\n
- Click Replace All
Let's assume
],
is the character where we wanted to break at
- Open
notePad++
- Open
Find window
Ctrl+F - Switch to
Replace
Tab - Choose
Search Mode
toExtended
- Type
],
inFind What
field -
Type
\n
inReplace with
field - Hit
Replace All
- Boom
Try this way. It got worked for me
- Open Notepad++ then copy your content
- Press
ctrl + h
- Find what is should be ,(comma) or any character that you want to replace
- Replace with should be \n
- Select Search Mode -> Extended (\n, \r, \t, \0)
- Then Click on Replace All
If the text contains \r\n that need to be converted into new lines use the 'Extended' or 'Regular expression' modes and escape the backslash character in 'Find what':
Find what: \\r\\n
Replace with: \r\n