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 “”.



Messages in this Thread

94,589 Postings in 11,932 Threads, 348 registered users, 25 users online (1 registered, 24 guests)
Index | Admin contact |   Forum Time: Nov 18, 2019 - 10:32 pm EST  |  Hits:29,171,288  (13,031 Today )
RSS Feed