Text Editor which shows \r\n?
Solution 1
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".
Solution 2
In vi(m), check out:
:help 'list'
:help 'listchars'
Solution 3
Sublime Text 3 has a plugin called RawLineEdit that will display line endings and allow the insertion of arbitrary line-ending type:
https://github.com/facelessuser/RawLineEdit
Solution 4
On the Windows platform the Zeus editor has an option to display white space (i.e. View, White sapce menu).
It also has an option to display the file in hex mode (i.e. Tools, Hex Dump menu).
Solution 5
You can get this in Emacs by changing the mode. For example, here is what things look like in Whitespace mode.
NickAldwin
Disclaimer: The man in the picture is not intended to represent NickAldwin's actual appearance. Any similarities between Dr. Strangelove and NickAldwin are completely coincidental.
Updated on July 08, 2022Comments
-
NickAldwin almost 2 years
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!-
paxdiablo over 14 yearsCygwin is not a prereq for Vim. gVim runs fine on native Windows.
-
-
paxdiablo over 14 yearsI challenge you to write that program in any language in a second :-)
-
Cem Kalyoncu over 14 yearsok, a small typo, it should be 10
-
Cem Kalyoncu over 14 yearsDon't vote me down, this is a valid solution, after all this is why PERL is created. Most importantly you can improve this method to search for any inconsistencies within a directory containing many files.
-
NickAldwin over 14 yearsBut I did say "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." (but I didn't vote you down).
-
NickAldwin over 14 yearsThanks. Here I've been using PSPad for years, preferring it over Notepad++, and now it fails me. Not only that, but there's a forum post where people are pleading the author to add that feature, and he basically tells them to go away. Maybe I'll consider switching to Notepad++...
-
MBarbosaEng over 11 yearsThe PSPad shows special characters: PSPad.com
-
Avatar over 9 yearsThanks for reminding me that it is under
View > Show Symbol
. Tip: Notepad++ is also great for finding characters and replacing them with line breaks, see details at superuser.com/q/34451/169199 -
M. Beausoleil over 7 yearsI really like the command
od -c filename.csv
. This one is working on the Terminal app. dr-palaniraja.blogspot.ca/2011/06/… -
Manius over 6 years8 years later... looks a bit outdated until some theme/font size changes (GTK+ FTW) but it still compiles fine. Java based editor, pretty cool! Somewhat impressed by this little project, handles large files faster than anything I've tried so far, very fast in general, and feature packed. Good one!
-
Simulant about 5 yearsAfter installing the plugin, how do I activate it that is shows the line endings?
-
Jim Aho about 5 years
shift + ctrl + p
is usually the way in Sublime to interact with plugins. Press these keys and start type the name of the plugin, you'll see the result.