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


--
Martijn

41 views      
 

Messages in this Thread

 
94,273 Postings in 11,892 Threads, 347 registered users, 8 users online (0 registered, 8 guests)
Index | Admin contact |   Forum Time: May 19, 2019 - 5:34 pm EDT  |  Hits:27,728,851  (10,789 Today )
RSS Feed