How to find multiple blank lines in Notepad++ and join the the separated text lines with a macro?

Below is screenshot of the file, where I want a macro to find out this blank line and correct the SEE and FIGURE should come to one line.

picture of the file

  • Ctrl+H
  • Find what: \R{2,}
  • Replace with: LEAVE EMPTY
  • check Wrap around
  • check Regular expression
  • Replace all


\R{2,}  : 2 or more any kind of linebreak, '\r' or '\n' or '\r\n'

Depending on what's actually on those lines it might already be sufficient to just Search & Replace \r\n\r\n in extended mode with nothing or maybe a space. If you do have more whitespace characters you could use a regular expression.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.