How to remove blank lines in Notepad++

02.11.2015
1 Star2 Stars3 Stars4 Stars5 Stars (3 votes, average: 5.00 out of 5)
Loading...

Hello, dear readers of my blog. I have already written posts about the feature-packed and user-friendly text editor, Notepad++, and some of its plugins. For me, this app is exciting and useful. Since it is impossible to highlight all of the features and functions of this excellent program in just one post, I’ve decided to describe different problems and solutions in smaller standalone posts just like this one.

The subject of this post concerns the problem of blank lines in a file. In some cases they must be deleted, for example if you have to copy lists with blank lines into the Notepad++ editor. There are two simple functions already built in to Notepad++ that can most likely solve all of your blank line problems:

1. First, you can choose the easiest way by opening the menu, then scrolling down the list of options and selecting “Edit” – “Line Operations”. You can then perform a function to either “Remove Empty Lines” or “Remove Empty Lines (Containing Blank characters)”:

Remove blank lines in Notepad++

The second one way is even more powerful, since it also removes blank lines formed by white space symbols (space, tab).

2. If you dislike the above method or you just want to try something different, then you can use the other option which is the advanced search and substitution. The hotkey combination for this feature is Ctrl + H. You can also find it by navigating to “Search”“Replace” in the top menu.

How to remove blank lines in Notepad++

In the bottom of a new window you’ll find the “Extended” search mode. Type in \n\r in the field “Find what” and in the “Replace with” filed – \0. Click “Replace All” and all blank lines in the open text will be removed.

Leave a Reply

Your email address will not be published. Required fields are marked *