Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Replace blank lines with specific text in Notepad ++

For example I have a text

Line1

Line3

Line5

Line6

And I need to replace the blank lines with a specific text, e.g. CoolText so the result would be

Line1
CoolText
Line3
CoolText
Line5
CoolText
Line6

How to accomplish this?

like image 426
Henry The Least Avatar asked Jan 19 '13 23:01

Henry The Least


Video Answer


1 Answers

You can use the extended replacement feature in NotePad++. Search for doubled carriage return/line feed pairs (\r\n\r\n), and replace them with a carriage return/line feed pair, the replacement text, and another CR/LF pair (\r\nCoolText\r\n).

Here's the text file with the dialog set up for the replacement, before clicking "Replace All":

NPP Before Replace Image

Here are the results after clicking "Replace All":

enter image description here

like image 119
Ken White Avatar answered Sep 20 '22 06:09

Ken White