Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Notepad++: Reducing multiple line breaks to single

My text document has multiple line breaks at random places. Want to use Notepad++ to reduce any multiple line breaks to a single line break. How can I accomplish that?

I am on the lines of using \n in extended Find/replace mode but can't quite get it.

like image 612
Kashif Avatar asked Oct 20 '25 08:10

Kashif


1 Answers

You can use a regular expression S&R:

(?:\r\n){2,}

or

\R{2,}

in the Find what field and

\r\n

in the Replace with field. You may adjust the replacement pattern as per your needs.

enter image description here

like image 60
Wiktor Stribiżew Avatar answered Oct 22 '25 23:10

Wiktor Stribiżew