MLUG: Re: [MLUG] text file cr/lf annoyance
Re: [MLUG] text file cr/lf annoyance
Email address obfuscation in effect -- please click here to turn it off.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
On Wed, 2 Oct 2002, Michael wrote:

> Again I'd suggest tr. IT's very good at removing all that crap.

The problem with tr is that it is indiscrimate -- it will delete all of
the ^M (\015)  characters, not just those at the end of the line.  That's
a small problem, I suppose, because we don't usually have a ^M character
anywhere else in a text file, but perl can take out only those at the end
of the line and leave the others alone.

Mike


> > It seems to me that this does what we want for an individual text
> > file:
> >
> > perl -pi -e 's/\015$//' filename

--
To unsubscribe, go to http://mlug.missouri.edu/members/edit.php

Archives are available at http://mlug.missouri.edu/list-archives/