Languages
[Edit]
EN

Remove empty lines with regex in Notepad++

11 points
Created by:
AnnLen
12160

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++
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