Files contain empty lines, If the file size is very small, You can delete it manually.
If the file contains a thousand lines, You want to find and remove empty lines.
It is very difficult and time-consuming to do it manually.
Notepad++ provides Find and replace feature to search and replace the text or patterns of text with new text.
How to Remove Empty or blank lines in Notepad++?
There are multiple ways you can remove the lines.
Use Line Operations
Open file in Notepad++ Editor.
Select Edit> Line Operations > select One of it
- Remove Empty Lines
- Remove Empty Lines( Containing Blank Characters)
It removes the empty or blank characters line from the entire file
The only disadvantage of this approach is, It will not work with part or selection of text in a file.
- Find and Search with regular expression
Find and search is an inbuilt feature in the editor.
Replaceor use Shortcut
Ctrl + H
Select and type below
^\R- for blank lines,
^\h*\Rfor blank lines with empty characters)
- Check Wrap Around
- Select Search Mode as
- Click on
Use TextFx plugin
- Select TextFx >TextFX Edit > Select
Delete Blank Linesor
Delete Surplus Blank Lines
- It removes empty lines and blank characters in empty lines.