Thursday, December 27, 2012

Remove blank lines using Notepad++

Say you have a document as shown below.

And you want to remove the blank lines - represented by {CR}{LF}. To do this using Notepad++, bring up Replace dialog (Search | Replace... or CTRL+H) and use ^\r\n in Find What and blank for Replace. In Search Mode, change it to Regular Expression. See below for an example.

What it does it use regular expression to search for carriage return and linefeed characters and match only if it is the beginning of the line (^). And of course replace it with a blank character.

No comments: