Re: Stupid Question: Striping Dos ^M From Texts
tr -d '\r' < dosfile > unixfile
removes all ^Ms, even if they are not at the end of the line
where MSDOS seems to put them. tr(1) is small and fast.
perl -p -i.bak -e 's/\r$//;' dosfile
renames the dosfile dosfile.bak and writes the corrected
output in dosfile. The $ "anchors" the search pattern to
the end of the line. Omit the "-i.bak" if you don't want
to save the old file.
Cameron
http://www.rahul.net/cameron/homepage.shtml
--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-user-request@lists.debian.org .
Trouble? e-mail to templin@bucknell.edu .
Reply to: