Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Text Editor which shows \r\n? [closed]

I'm looking for a text editor that can show me the actual carriage returns and newlines.

E.g. if I save this string: "This\rIs\r\nA\nString"

Instead of showing

This
Is
A
String

I'm looking for some text editor which will show

This\rIs\r\nA\nString

I believe a problem with my text-file parsing in a certain program is being caused by inconsistent newline/carriage return/both on the ends of lines.

I could just make a program which can read a file and display it with that formatting, but I figured it'd be easier if anyone knew of one that can already do it.

Thanks!

[EDIT]
Forgot to specify I'm on Windows, and installing Cygwin isn't really an option. Otherwise I would use vi or vim.
Also, if there's a way to do this in PSPad, which is already installed, it would be awesome if you knew that too. Thanks!

like image 364
NickAldwin Avatar asked Oct 22 '22 07:10

NickAldwin


People also ask

How do you show n in Notepad++?

Open any text file and click on the pilcrow (¶) button. Notepad++ will show all of the characters with newline characters in either the CR and LF format. If it is a Windows EOL encoded file, the newline characters of CR LF will appear (\r\n). If the file is UNIX or Mac EOL encoded, then it will only show LF (\n).

How do I show CR LF in Notepad++?

In Notepad++ go to the View > Show Symbol menu and select Show End of Line. Once you select View > Show Symbol > Show End of Line you can see the CR LF characters visually.

How do you find the line break?

Press Ctrl+F. Word displays the Navigation task pane at the left side of the screen. In the box at the top of the Navigation pane, enter the text for which you want to search. To search for a paragraph mark, enter ^p; to search for a line break, enter ^l.


2 Answers

With Notepad++, you can show end-of-line characters. It shows CR and LF, instead of "\r" and "\n", but it gets the point across. However, it will still insert the line breaks. But you do get to see the line-ending characters.

To use Notepad++ for this, open the View menu, open the Show Symbols slide out, and select either "Show all characters" or "Show end-of-line characters".

enter image description here

like image 257
Thomas Owens Avatar answered Oct 23 '22 19:10

Thomas Owens


In vi(m), check out:

:help 'list'
:help 'listchars' 
like image 10
Nick Presta Avatar answered Oct 23 '22 20:10

Nick Presta