


Click the Replace All button to replace all blank lines.Ībove, the Notepad++ regular expression looks for new lines (^) with a carriage return (\r) and newline (\n).In the Search Mode section, make sure Regular expression is selected.Leave the Replace with section blank unless you want to replace a blank line with other text. In the Replace box, in the Find what section, type ^\r\n (five characters: caret, backslash 'r', and backslash 'n').In the file menu, click Search and then Replace.Open Notepad++ and the file you want to edit.

Download Notepad++ if not already installed on the computer.Follow the steps below to replace blank lines in your file using Notepad++. Notepad++ is a fantastic free text editor for Microsoft Windows computers that supports regular expression search and replace to replace blank lines in one or more files. Let's look at some other properties of Matcher that might help us: while (matcher.See our removing blank lines with regular expressions section below for how this tool and other tools use regular expressions to replace blank lines. However, if each of these words were a token that we wanted to replace, we would need to have more information about the match in order to build the resulting string.
