A text editor that shows \ r \ n?

I am looking for a text editor that can show me the actual carriage returns and new lines.

eg. if I save this line: "This\rIs\r\nA\nString"

Instead of showing

 This Is A String 

I am looking for a text editor that will show

 This\rIs\r\nA\nString 

I believe that the problem with parsing a text file in a certain program is caused by inconsistent news / carriage return / at the ends of lines.

I could just create a program that can read the file and display it with this formatting, but I decided that it would be easier if anyone knew about it, which can already do it.

Thank!

[EDIT]
I forgot to point out that I'm on Windows, and installing Cygwin is actually not an option. Otherwise, I would use vi or vim.
Also, if there is a way to do this in a PSPad that is already installed, it would be great if you knew that. Thank!

+113
text newline carriage-return text-editor
Sep 18 '09 at 19:11
source share
17 answers

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

To use Notepad ++ for this, open the View menu, open Show Characters, and choose Show All Characters or Show End Of Line Characters.

enter image description here

+209
Sep 18 '09 at 19:14
source share

In vi (m) check:

 :help 'list' :help 'listchars' 
+10
Sep 18 '09 at 19:19
source share

Sublime Text 3 has a plugin called RawLineEdit that displays the end of a line and allows you to insert an arbitrary type of line ending:

https://github.com/facelessuser/RawLineEdit

+7
Aug 21 '14 at 9:27
source share

You can get this in Emacs by changing the mode. For example, here's how it looks in Space mode.

alt text

+4
Sep 18 '09 at 19:16
source share

On the Windows platform, the Zeus editor has the ability to display a space (for example, the View menu, White Sapphire).

It also has the ability to display the file in hexadecimal mode (ie Service, menu "Hex Dump").

+4
Sep 21 '09 at 0:22
source share

I would promise that the Notebook programmer will give you something like this ...

+2
Sep 18 '09 at 19:14
source share

Write a small program that does the trick. Depending on the language you use, it takes from 10 seconds to 1 minute. Faster than installing any application. On the command line with the correct PHP setting

 php -q <?php $t=file_get_contents("filename"); echo str_replace(array("\n", "\r"), array("\\n", "\\r"), $t); ?> 
+2
Sep 18 '09 at 19:29
source share

Try Notepad ++ . It shows all the characters. Alternatively, you can use dos2unix utility to convert the file to all / n or "conv" (same link) to convert anyway.

+1
Sep 18 '09 at 19:15
source share

vi can display all characters.

+1
Sep 18 '09 at 19:16
source share

I am a big fan of JEdit . It is very powerful and cross platform. A plugin called Whitespace is available there that can do what you want. If this is not enough, there is a hexadecimal lookup plugin and a hexadecimal edit plugin.

+1
Sep 18 '09 at 19:23
source share

SciTE does it very well with a single keystroke. It is also able to detect, probably, the current line of the end of the file (in the case of mixed lines) and convert them.
No need to install, easy, it can be used as a tool, even if you do not want to abandon your favorite editor.

+1
Sep 18 '09 at 21:04
source share

EmEditor does this. You can also customize the display of characters for display.

0
Sep 18 '09 at 19:26
source share

GVIM works on Windows, and there is VIM for cmd.

Check out http://www.vim.org/download.php

In addition, quick browsing of documents or google, or some vimmy friends can help you quickly find and replace VIM to fix the problem you are facing, I believe.

0
Sep 18 '09 at 19:27
source share

If you have Mathematica, you can try with this command:

 ReadList["filename.txt", Record, RecordSeparators -> {}] // InputForm 

This will show all / r and / n

0
Sep 18 '09 at 19:35
source share

Slickedit and Notepad2 also show them. In Slickedit, you can customize all kinds of invisible characters (spaces, tabs, CR, line channels, etc.) and display them with any character you want.

0
Sep 21 '09 at 0:54
source share

It is best to replace \ n \ t and more: programmer's file editor http://www.lancs.ac.uk/staff/steveb/cpaap/pfe/pfefiles.htm

0
Jan 19 '13 at 12:54 on
source share

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

0
Apr 03 '16 at 4:53 on
source share



All Articles