You are on page 1of 2

10/1/2016 texteditingReplace\r\nwithnewlineinNotepad++SuperUser

signup login tour help

_
SuperUserisaquestionandanswer Here'showitworks:
siteforcomputerenthusiastsandpower
users.Jointhemitonlytakesaminute:

Signup
Anybodycanask Anybodycan Thebestanswersarevoted
aquestion answer upandrisetothetop

Replace\r\nwithnewlineinNotepad++

HowdoIreplacethestring"\r\n"withthesamecharacters?

Example:

HelloWorld.\r\nHelloWorld.

replacedwith:

HelloWorld.
HelloWorld.

notepad++ textediting

editedFeb15'14at19:06 askedSep17'09at13:59
PeterMortensen C.Ross
7,128 13 51 79 1,739 9 41 69

3Answers

Press CTRLh andtheReplacedialogwillopen.Type \\r\\n in"Findwhat"and \r\n in


"Replacewith".Finally,selectsearchmodeExtended(\r,\n,\t,\x...,\0)andclick"ReplaceAll".

editedNov13'15at17:07 answeredSep17'09at14:04
MarcusMangelsdorf spatz
305 2 11 2,745 1 13 10

1 worksinProgrammer'snotepadaswell.Select"Allowbackslashexpressions"anddothesame
PeterMunnings Jul3'12at19:05

DoesthatworkinnewerversionsofNotepad++?Ordoesitrequireselectingtheoption"Extended(\n,\r,\t,
\0,\x)"?PeterMortensenFeb15'14at19:14

1 Searchmodehastobe"Extended"towork.MarcelMar19'14at16:06

Thisalsoworksinnotepad2incaseanyoneisinterested.Checkregularexpressionsearchwhenreplacing
HoppeMar31'14at16:39

YoucouldalsodowhatIdidandturnoffextendedsearchthenreplace\r\nwithsomeuniquestringlike
"~~~~"thenturnextendedsearchbackonandreplacethatstringwith\r\n.Anextrastepbutitworks.
SteveHinerOct4'14at0:11

Inthefindscreen,onthereplacetabchooseextendedsearch.
Inthefindtextboxput \\r\\n ,andinthereplacetextboxput \r\n .

editedJun18'12at10:38 answeredSep17'09at14:03
C.Ross
1,739 9 41 69

Doesthisactuallywork,ordoyouneedtodoescaping? JoshHunt Sep17'09at14:21

Ihadescaping,butIhadtodoubleescapeitforittoshowuprighthere(ie\\\\r\\\\ninsteadof\\r\\n).
C.Ross Sep17'09at14:55

Sodidyoujustnowhavetoquadrupleescapethatinthecomment?^^^^^^^ hyperslug Sep17'09at15:31

Nothankfullyitdoesn'ttrytointerpretcomments... C.Ross Sep18'09at14:55

CopyanewlineandusetheSearchandReplacefunctiontoreplace\r\nwiththenewline.The
newlinecharacterwillshowupasanemptybox.

answeredSep17'09at14:04
Linus
609 3 10

Icouldn'tgetthistoworkearlier. C.Ross Sep17'09at14:56


http://superuser.com/questions/42670/replacernwithnewlineinnotepad 1/2
10/1/2016 texteditingReplace\r\nwithnewlineinNotepad++SuperUser
1 Icouldn'tgetthistoworkearlier. C.Ross Sep17'09at14:56

http://superuser.com/questions/42670/replacernwithnewlineinnotepad 2/2