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

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!

This question is related to text text-editor newline carriage-return

The answer is


I'd bet that Programmer's Notepad would give you something like that...


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

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

Also, a quick look through the docs or google, or some vimmy friends can help you to use VIM's quick search and replace to fix the problem you are having I believe.


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


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.


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.


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


vi can show all characters.


SciTE does that very well with a single keystroke. It is also able to detect the most probably current line ending of the file (in case of mixed lines) and to convert them.
No need to install, lightweight, it can be used as a tool even if you don't want to give up your favorite editor.


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


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

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

That will show all the /r and /n


EmEditor does this. You can also customize what symbols actually display to show them.


Write a small program that does the trick. Depending on the language you use it takes between 10 seconds to 1 min. Faster than installing any application for sure. In command line with proper setup PHP

php -q

<?php $t=file_get_contents("filename"); echo str_replace(array("\n", "\r"), array("\\n", "\\r"), $t); ?>

Slickedit and Notepad2 also show them. In Slickedit you can customize all sorts of invisible characters (whitespace, tabs, CRs, line feeds, ...) and display them with any character you wish.


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


In vi(m), check out:

:help 'list'
:help 'listchars' 

You can get this in Emacs by changing the mode. For example, here is what things look like in Whitespace mode.

alt text


Examples related to text

Difference between opening a file in binary vs text How do I center text vertically and horizontally in Flutter? How to `wget` a list of URLs in a text file? Convert txt to csv python script Reading local text file into a JavaScript array Python: How to increase/reduce the fontsize of x and y tick labels? How can I insert a line break into a <Text> component in React Native? How to split large text file in windows? Copy text from nano editor to shell Atom menu is missing. How do I re-enable

Examples related to text-editor

Find duplicates and delete all in notepad++ How to run vi on docker container? How to run a program in Atom Editor? How to call VS Code Editor from terminal / command line What is the difference between Sublime text and Github's Atom Multiple select in Visual Studio? change cursor from block or rectangle to line? Javascript button to insert a big black dot (•) into a html textarea Vim multiline editing like in sublimetext? Edit a text file on the console using Powershell

Examples related to newline

How can I insert a line break into a <Text> component in React Native? Print "\n" or newline characters as part of the output on terminal Using tr to replace newline with space How to write one new line in Bitbucket markdown? Line break in SSRS expression How to insert a new line in Linux shell script? Replace CRLF using powershell How to write new line character to a file in Java What is the newline character in the C language: \r or \n? How to print values separated by spaces instead of new lines in Python 2.7

Examples related to carriage-return

Create Carriage Return in PHP String? What is the difference between a "line feed" and a "carriage return"? How can I insert new line/carriage returns into an element.textContent? What are the differences between char literals '\n' and '\r' in Java? What's the Use of '\r' escape sequence? Carriage return and Line feed... Are both required in C#? Find and replace - Add carriage return OR Newline In C#, what's the difference between \n and \r\n? See line breaks and carriage returns in editor What are carriage return, linefeed, and form feed?