loptc.blogg.se

Notepad ++ remove blank lines
Notepad ++ remove blank lines







If you would like to delete any surplus pure blank line ( in other words, keeping ONLY ONE blank line, as a paragraphs separator ), just change the search regex into \R\R\K\R+. The syntax \h represents any horizontal blank character, that is to say, either the Space character ( \x20), the Tabulation character ( \x09 ) or the No-Break Space character ( \xA0 ) Again, the Replace with zone stays empty. If, in addition, you would like to delete lines containing ONLY blank characters, use the search regex ^(\h*\R)+. The interest of \R syntax is that it matches any kind of EOL ( \r\n of a Windows file, \n of a Unix/OSX file and \r of an Old Mac file ) In fact, strictly speaking \R = \r\n| but practically, it is, most of the time, identical to \r\n|\n|\r ( The order of the alternatives is important ! ) Type the regex ^\R+ in the Find what zoneįill up the Filters and the Directory fieldsĪll at once, your test files won’t contain any pure empty line.

notepad ++ remove blank lines notepad ++ remove blank lines notepad ++ remove blank lines

Open the Find in Files dialog ( CTRL + SHIFT + F ) So, I would suggest to copy a couple of files in a new folder to test it, first ! Here is a very simple regex which will delete any pure empty line, whatever its End of Line character(s) :īut above all, the warning of AdrianHHH is quite sensible.









Notepad ++ remove blank lines