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 a 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 the 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 character line from the entire file
The only disadvantage of this approach is that 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.
Open
Search>Replaceor use ShortcutCtrl + HIt opens
ReplaceWindowSelect and type below
Find Whatwith^\R- for blank lines,^\h*\Rfor blank lines with empty characters)Replace withempty- Check Wrap Around
- Select Search Mode as
Regular Expression - Click on the
Replace Allbutton.
Use TextFx plugin
- First,
TextFxplugin - Select TextFx >TextFX Edit > Select
Delete Blank LinesorDelete Surplus Blank Lines - It removes empty lines and blank characters in empty lines.
- First,