显示\ r \ n的文本编辑器? [英] Text Editor which shows \r\n?

查看:766
本文介绍了显示\ r \ n的文本编辑器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一个文本编辑器,可以向我显示实际的回车符和换行符.

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

例如如果我保存以下字符串:"This\rIs\r\nA\nString"

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

而不是显示

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.

谢谢!


忘记指定我在Windows上,安装Cygwin并不是真正的选择.否则,我会使用vi或vim.
另外,如果已经安装了PSPad中执行此操作的方法,那么如果您也知道这一点,那就太好了.谢谢!


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!

推荐答案

使用 Notepad ++ ,您可以显示行尾字符.它显示了CR和LF,而不是"\ r"和"\ n",但可以理解这一点.但是,它仍将插入换行符.但是您确实可以看到行尾字符.

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.

要为此使用Notepad ++,请打开查看"菜单,打开显示符号"滑盖,然后选择显示所有字符"或显示行尾字符".

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".

这篇关于显示\ r \ n的文本编辑器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆