Sublime Forum

Replace \n\n\n by \n\n

#1

Anyone know how to do this? I want to remove all empty lines if they are more than two, consecutive.

In Scite I enable backslash expressions (or escape sequences or something) and replace \r\n\r\n\r\n by \r\n\r\n, and repeat that, to get rid of large empty space that I had created.

Whatever I try with sublime, with regexp and [\r\n\r\n\r\n], it replaces it by stray <0x0d> cariage returns or so.

Tried [\r\n\r\n\r\n], \r\n\r\n\r\n, I don’t understand what Sublime does or why there is nothing like it is in Scite or VS or so. : )

Thanks…

0 Likes

#2

You can use regex mode to replace \n{3,} with \n\n. ST normalize all line ending to \n internally so no need to use \r\n.

2 Likes

#3

Works like a charme, thanks so much.

0 Likes