Notepad++ - How can I replace blank lines [duplicate]

  1. Press Ctrl+H (Replace)

  2. Select Extended from SearchMode

  3. Put \r\n\r\n in Find What

  4. Put \r\n in ReplaceWith

  5. Click on Replace All

Replace multiple line breaks


As of NP++ V6.2.3 (nor sure about older versions) simply:

  1. Go menu -> Edit -> Line operations
  2. Choose "Remove Empty Lines" or "Remove Empty Lines (Containing white spaces)" according to your needs.

Hope this helps to achieve goal in simple and yet fast way:)


By the way, in Notepad++ there's built-in plugin that can handle this: TextFX -> TextFX Edit -> Delete Blank Lines (first press CTRL+A to select all).