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

2020-01-27 02:37发布

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!

17条回答
唯我独甜
2楼-- · 2020-01-27 03:01

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

查看更多
虎瘦雄心在
3楼-- · 2020-01-27 03:01

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.

查看更多
叼着烟拽天下
4楼-- · 2020-01-27 03:01

Sorry to join the bandwagon so late but in Windows 10, Notepad2 will show them. Choose from the menu View\Show Line Endings

查看更多
疯言疯语
5楼-- · 2020-01-27 03:02

The best for replace \n \t and more: Programmer's File Editor http://www.lancs.ac.uk/staff/steveb/cpaap/pfe/pfefiles.htm

查看更多
Melony?
6楼-- · 2020-01-27 03:03

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.

查看更多
登录 后发表回答