13

I've pasted some XML into Notepad++. The pasted text contains \r\n wherever a newline is supposed to occur. However, Notepad++ is just showing the entire file on a single line. It is as if it is ignoring the \r\n

So the text look like this:

Some stuff on one line\r\n     Some stuff that should be on another line\r\n

Instead of:

Some stuff on one line
Some stuff that should be on another line
Curtis
  • 5,794
  • 8
  • 50
  • 77
  • 1
    See this http://superuser.com/questions/274509/how-to-display-r-n-as-new-line-in-notepad to summarize: Replace regexp \\r\\n with \n. – Jeff Anderson Aug 14 '14 at 16:19

4 Answers4

18

enter image description here

Press Ctrl+H and the Replace dialog will open.

  1. Type \\r\\n in "Find what"
  2. Type \r\n in "Replace with".
  3. select search mode Extended (\r, \n, \t, \x..., \0)
  4. click "Replace All"
ehsan
  • 181
  • 1
  • 4
2

Try setting the search mode in Notepad++ to Extended. Then, find and replace all the /r/n with an actual line break(\n). See: This post for more information about this similar case. From what I found, you can get away with simply \n.

Community
  • 1
  • 1
Adam
  • 2,422
  • 18
  • 29
1

Press Ctrl+H and the Replace dialog will open, then follow the steps:

  1. type \r\n in "Find what".
  2. type \\\r\\\n in "Replace with"
  3. select search mode to Extended (\r, \n, \t, \x, ..., \0)
  4. click Replace button It works for me to display \r\n. see my screenshot
maciejwww
  • 1,067
  • 1
  • 13
  • 26
yuc
  • 13
  • 5
  • Please, use a list to make your answer more clear and display picture (use `!` before `[...] bracket`. – maciejwww Sep 24 '20 at 09:50
  • fail to display the picture as i do not have 10 reputation, system said that You need at least 10 reputation to post images. – yuc Sep 25 '20 at 10:09
1

Press Ctrl+H and the Replace dialog will open, then follow the steps:

  1. type \r\n in "Find what"
  2. type \\r\\n in "Replace with"
  3. select search mode to "Extended (\r, \n, \t, \x, ..., \0)"
  4. click "Replace" button

It works for me to display \r\n.

enter image description here

ZygD
  • 22,092
  • 39
  • 79
  • 102