You are not logged in.

#1 2019-01-25 04:18:52

huzo11
Member
Registered: 2018-10-31
Posts: 60

Notepad++ in Arch Linux or an alternative to show CR and LF

Hello, 
So I need to be able to see the carriage returns and new lines in my text file (\r\n). I know that Notepad++ has an option to view everything. But I think there is no Notepad++ for Arch? What else could be an alternative way? I think vim does not offer what I want. 

Thanks!


Be nice and live for others.
https://prismatically.blog

Offline

#2 2019-01-25 04:32:48

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,510
Website

Re: Notepad++ in Arch Linux or an alternative to show CR and LF

Vim most certainly does.  See the documentation for 'set list'.

Last edited by Trilby (2019-01-25 04:35:24)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#3 2019-01-25 04:44:15

huzo11
Member
Registered: 2018-10-31
Posts: 60

Re: Notepad++ in Arch Linux or an alternative to show CR and LF

Trilby wrote:

Vim most certainly does.  See the documentation for 'set list'.

It only shows \n but not carriage returns


Be nice and live for others.
https://prismatically.blog

Offline

#4 2019-01-25 04:49:56

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,510
Website

Re: Notepad++ in Arch Linux or an alternative to show CR and LF

It shows \r as ^M and \n as $, they're both there.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#5 2019-01-25 07:31:32

Shawn8901
Member
Registered: 2013-05-07
Posts: 38

Re: Notepad++ in Arch Linux or an alternative to show CR and LF

Maybe as additional hint from my side.
Unix style linefeeds only use LF and does NOT contain a CR. So it's very likely that there is no CR if you are in a pure non windows environment

Offline

#6 2019-01-25 10:03:12

Morn
Member
Registered: 2012-09-02
Posts: 886

Re: Notepad++ in Arch Linux or an alternative to show CR and LF

Notepadqq is the Open Source clone of Notepad++, maybe that would work.

Offline

#7 2019-01-25 13:34:44

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,510
Website

Re: Notepad++ in Arch Linux or an alternative to show CR and LF

Shawn8901 wrote:

Maybe as additional hint from my side.
Unix style linefeeds only use LF and does NOT contain a CR. So it's very likely that there is no CR if you are in a pure non windows environment

Yes, I've used computers before.  \r is CR \n is LF, these were specifically referred to in my previous post.

Note that the above-mentioned notepadqq does have options to show many whitespace and non-printing characters, but CR or \r are not among these in that program.  But vim will.

EDIT: OOPS! I need to have coffee before posting.  I thought the above was the OP replying to me and interpreted as a patronizing dismissal of my input.  None of that was the case.  Sorry for the noise.

Last edited by Trilby (2019-01-25 13:55:10)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#8 2019-01-25 13:45:24

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,613

Re: Notepad++ in Arch Linux or an alternative to show CR and LF

I think Shawn8901 was addressing the OP, assuming the latter expected to see CRs where are just none and therefore falsely inferring a missing feature.

Also, for the lulz, the entire mess: https://en.wikipedia.org/wiki/Newline

Offline

#9 2019-01-25 13:46:02

drcouzelis
Member
From: Connecticut, USA
Registered: 2009-11-09
Posts: 4,092
Website

Re: Notepad++ in Arch Linux or an alternative to show CR and LF

huzo11 wrote:

So I need to be able to see the carriage returns and new lines in my text file (\r\n).

Yes! The Geany program has that feature. Under Edit -> Preferences -> Editor -> Display tab -> Show line endings. (NOTE: It may be in a little different location on a newer version of the program.) A Unix file now shows "LF" at the end of every line, and a Windows file shows "CR LF". smile

By the way, I often suggest Geany as an excellent option for a fast, lightweight, yet feature rich text editor for Linux. It can easily be overlooked because it's usually called an IDE for programmers. But if you simply click on the View menu and disable the Sidebar and the Message Window (and whatever else) I think you'll feel right at home after using Notepad++.

Offline

#10 2019-01-25 17:21:27

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,700

Re: Notepad++ in Arch Linux or an alternative to show CR and LF

In emacs, do a revert-buffer-with-coding-system and set the coding to utf-8-unix.  Now the ^M are visible.
Then, enable whitespace-mode and all of the other whitespace characters will be shown as well.

Edit:  Or. you can use hexl mode.

Last edited by ewaller (2019-01-25 17:23:48)


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

Board footer

Powered by FluxBB