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)”:
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.
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.