Discussion:
DOS line endings - how to cope with these?
Helmut Jarausch
2010-05-10 10:14:49 UTC
Permalink
Hi,

is there any option to tell NEdit to mark (backlight) DOS line endings
specially?

Furthermore, I tried to remove these by replacing \r with nothing
in Regex mode, but it didn't remove them.
Is this a bug or is there an option for 'intelligent' line end
handling somewhere.

Many thanks for a hint,
Helmut.

nedit -V gives
NEdit release of Aug 20, 2004

Built on: Linux, x86-64, GNU C
Built at: Sep 30 2009, 16:50:25
With Motif: (Untested) 2.3.1 [@(#)Motif Version 2.3.2]
Running Motif: 2.3 [unknown]
Server: The X.Org Foundation 10706000
Visual: 24-bit TrueColor (ID 0x23, Default)
Locale: en_US.iso88591
--
NEdit Discuss mailing list - Discuss-***@public.gmane.org
http://www.nedit.org/mailman/listinfo/discuss
Offer Kaye
2010-05-10 12:22:38 UTC
Permalink
Post by Helmut Jarausch
Hi,
is there any option to tell NEdit to mark (backlight) DOS line endings
specially?
Furthermore, I tried to remove these by replacing \r with nothing
in Regex mode, but it didn't remove them.
Is this a bug or is there an option for 'intelligent' line end
handling somewhere.
Many thanks for a hint,
Helmut.
You can always do File -> Save As... and in the window select the
"Unix" option instead of "DOS". Type the same file name and approve
the dialog that comes up which asks you to confirm the file override.

I don't know the answers to your other questions, sorry.

Regards,
--
Offer Kaye
--
NEdit Discuss mailing list - Discuss-***@public.gmane.org
http://www.nedit.org/mailman/listinfo/discuss
Andrew Hood
2010-05-10 13:10:58 UTC
Permalink
Post by Offer Kaye
You can always do File -> Save As... and in the window select the
"Unix" option instead of "DOS". Type the same file name and approve
the dialog that comes up which asks you to confirm the file override.
I don't know the answers to your other questions, sorry.
This has always annoyed me, but not enough to get around to fixing it.

What it needs is a menu item somewhere to set which line ending you want
without having to fudge it through "Save As". Notepad++ does that so
others have decided it is worth doing.
--
There's no point in being grown up if you can't be childish sometimes.
-- Dr. Who
--
NEdit Discuss mailing list - Discuss-***@public.gmane.org
http://www.nedit.org/mailman/listinfo/discuss
TK Soh
2010-05-11 09:12:17 UTC
Permalink
Post by Andrew Hood
Post by Offer Kaye
You can always do File -> Save As... and in the window select the
"Unix" option instead of "DOS". Type the same file name and approve
the dialog that comes up which asks you to confirm the file override.
I don't know the answers to your other questions, sorry.
This has always annoyed me, but not enough to get around to fixing it.
What it needs is a menu item somewhere to set which line ending you want
without having to fudge it through "Save As". Notepad++ does that so
others have decided it is worth doing.
+1
--
NEdit Discuss mailing list - Discuss-***@public.gmane.org
http://www.nedit.org/mailman/listinfo/discuss
Greg Edwards
2010-05-11 22:31:53 UTC
Permalink
This post might be inappropriate. Click to display it.
Volker Kuhlmann
2010-05-23 07:31:05 UTC
Permalink
Post by Greg Edwards
I offer my trusted Perl hack for line-endings.
cat file | perl -p -e 's/(\r\n|\r|\n)/\n/g' > file2
Agh. Some people have to hit everything with the same hammer^H^H^Hperl.

tr -d '\r' <file >file2

Will also delete CRs within a line - as does your perl thingy.

It's possible to remove CR in nedit only if nedit doesn't go into DOS
mode, that is if the first line ends in LF and not CRLF.

Volker
--
Volker Kuhlmann
http://volker.dnsalias.net/ Please do not CC list postings to me.
--
NEdit Discuss mailing list - Discuss-***@public.gmane.org
http://www.nedit.org/mailman/listinfo/discuss
Bert Wesarg
2010-05-10 12:59:53 UTC
Permalink
This post might be inappropriate. Click to display it.
Continue reading on narkive:
Loading...