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?
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":
Here are the results after clicking "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