Languages
[Edit]
EN

Remove empty lines with regex in Notepad++

23 points
Created by:
Aisha
418

In this article we are going to look how to remove empty lines with Notepad++.

Presented below solution uses regex to do it (uses regular expressions).

Quick steps:

  1. open Notepad++,
  2. go to Replace window (in menu Search -> Replace... or press ctrl + H),
  3. in Search Mode group-box select Regular expression radio button,
  4. enter below regex in Find what input:

    ^\R
  5. enter below line in Replace with input:

    >> Leave it EMPTY <<
  6. click on Replace All button

  • Text before:

    line 1
    
    
    line 2
    
    line 3
    line 4
  • Text after:

    line 1
    line 2
    line 3
    line 4

Look at below screenshots:

Remove all empty lines with regex in Notepad++
Remove all empty lines with regex in Notepad++
Removed all empty lines with regex in Notepad++
Removed all empty lines with regex in Notepad++

 Reference

  1. Notepad++ - Wiki
  2. Download Notepad++

Alternative titles

  1. Npp - regex replace empty lines with nothing (Notepad++ remove empty lines)
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.

Notepad++

Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join