Split a string up into rows by delimiter in Notepad++

Use the search string:

\|

With the replacement string:

\|\r\n

You are running the command in REGEX mode, and the | in the search string will be picked up as a REGEX operator, it simply needs to be escaped.


Just use Extended Search Mode instead Normal or Regular expression ones.

NPP extended search


I want to replace | with |<cr><lf>

Note: | is a special character (alternation operator) in a regular expression, so it needs to be escaped using the escape character \.

  • Menu "Search" > "Replace" (or Ctrl + H)

  • Set "Find what" to \|

  • Set "Replace with" to |\r\n

  • Enable "Regular expression"

  • Click "Replace All"

Image

Before:

some data||some data||||

After:

some data|
|
some data|
|
|
|

Further reading

  • Notepad++: A guide to using regular expressions and extended search mode
  • Regular Expressions Tutorial
  • RegExr: Learn, Build, & Test RegEx