Re: DOS line endings - how to cope with these?

Greg Edwards <[email protected]> Wed, 12 May 2010 08:31:53 +1000
Newsgroups gmane.editors.nedit.user
Message-ID <[email protected]>
Nedit folks,

I offer my trusted Perl hack for line-endings. Over the years it's become
the only thing I use for 100% reliablity on all platforms. Perl in stream
mode has totally robust handling of \r and \n.

cat file | perl -p -e 's/(\r\n|\r|\n)/\n/g' > file2

Greg E


On Tue, May 11, 2010 at 7:12 PM, TK Soh <[email protected]> wrote:

> On Mon, May 10, 2010 at 1:10 PM, Andrew Hood <[email protected]> wrote:
> > Offer Kaye wrote:
> >> 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 - [email protected]
> http://www.nedit.org/mailman/listinfo/discuss
>



-- 
Greg Edwards
[email protected], mb +61 400 102 774
-- 
NEdit Discuss mailing list - [email protected]
http://www.nedit.org/mailman/listinfo/discuss