I have a text file with a thousand lines of numbers like so:
402 115 90 ...
As you can see there is a blank line in between each number that I want to remove so that I have
402 115 90 ...
How can I do this?
First you need to open the file with Notepad++. Once the document is loaded, select Edit > Line Operations > Remove Empty Lines. Voilà, every single blank lines has been deleted.
Click Search and then Replace. In the Replace window, in the Find what section, type ^\n (caret, backslash 'n') and leave the Replace with section blank, unless you want to replace a blank line with other text. Check the Regular Expression box. Click the Replace All button to replace all blank lines.
Edit > Line operations > Remove Empty Lines and NotePad++ removes ALL the empty lines in the entire document!
Within notepad there is no way to use the Find and Replace and target blank lines. Consider Notepad++ and the regex search and replace. You can use \r\n to find blank lines from text files made within Windows, \r for Mac and \n for Linux.
Press Ctrl+H (Replace)
Select Extended
from SearchMode
Put \r\n\r\n
in Find What
Put \r\n
in ReplaceWith
Click on Replace All
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With