ZTree.com  | ZEN  | About...  

 Index   Back

Notepad++   [Help!]

By: Martijn Coppoolse   Homepage   Voorburg, NL  
Date: May 14,2019 at 10:55
In Response to: Notepad++ (Neil Clough)

> > I use Notepad++, which has an advanced search and replace, which
> > allows you to type control+M to enter a newline in either the search
> > field or the replace field. It can also do it with regex, but I find
> this
> > simpler.
> Hi Peter,
> Must be missing something.
> Ctrl M didn't do anything.

It didn’t for me either.

> Tried Setting Regular expression on but it cannot find "\n"

If it’s a file with Windows line endings (CR+LF), you'd have to use \r\n, (\n is equivalent to LF, \r is CR).

> So far only TextPad can do this.

Notepad++ can do this in two ways (using its default search-and-replace dialog):

1. using the "extended" search and replace mode, search for $\r\n, and replace it with nothing.
2. using the "regular expression" search mode, search for \$\r\n, and replace it with nothing. (If you're not sure which line endings you've got, you could use \$(\r\n|\r|\n) instead). Do make sure NOT to check the box “”.


Thread locked

Messages in this Thread

95,075 Postings in 11,986 Threads, 350 registered users, 126 users online (1 registered, 125 guests)
Index | Admin contact |   Forum Time: Aug 12, 2020 - 11:32 pm EDT  |  Hits:33,075,298  (23,656 Today )
RSS Feed