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!
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
I am a huge fan of JEdit. It's very powerful, and cross-platform. There's a plugin available for it called Whitespace which can do what you want. If that's not enough, there's a hex viewing plugin and a hex editing plugin.
Sorry to join the bandwagon so late but in Windows 10, Notepad2 will show them. Choose from the menu
View\Show Line Endings
The best for replace \n \t and more: Programmer's File Editor http://www.lancs.ac.uk/staff/steveb/cpaap/pfe/pfefiles.htm
Try Notepad++. It shows all characters. In addition, you could use the utility dos2unix to convert a file to all /n, or "conv" (same link) to convert either way.