Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Notepad++ - How can I replace blank lines [duplicate]

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?

like image 613
Joeblackdev Avatar asked Aug 07 '11 17:08

Joeblackdev


People also ask

How do I replace blank lines in notepad?

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.

How do you replace blank lines?

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.

How do I get rid of blank new lines in Notepad++?

Edit > Line operations > Remove Empty Lines and NotePad++ removes ALL the empty lines in the entire document!

How do you Find blank lines in notepad?

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.


1 Answers

  1. Press Ctrl+H (Replace)

  2. Select Extended from SearchMode

  3. Put \r\n\r\n in Find What

  4. Put \r\n in ReplaceWith

  5. Click on Replace All

Replace multiple line breaks

like image 157
YetAnotherUser Avatar answered Sep 21 '22 19:09

YetAnotherUser