Removing empty lines in Notepad++

前端 未结 22 1878
时光取名叫无心
时光取名叫无心 2020-11-28 00:04

How can I replace empty lines in Notepad++? I tried a find and replace with the empty lines in the find, and nothing in the replace, but it did not work; it probably needs r

22条回答
  •  没有蜡笔的小新
    2020-11-28 00:51

    This obviously does not work if the blank lines contain tabs or blanks. Many web pages (e.g. http://www.guardian.co.uk/) contain these white lines, as a result of a faulty HTML editor.

    Remove white space using regular expression as follows:

    change pattern: [\t ]+$ into nothing.

    where [\t ] matches either tab or space. '+' matches one or more occurrences, and '$' marks the end of line.

    Then use notepad++/textFX to remove single or extra empty lines. Be sure that these blank lines are not significant in the given context.

提交回复
热议问题