Sim,

cat filename | sed 's/^M//g' > newfilename

Where ^M is ^V^M (Ctrl+vCtrl+m)
[means Insert Special Character ^M]

If you have a lot and they are the only files in the
directory:

for file in `/bin/ls -1`    # Stays away from "ls aliases"
do
echo "Doing $file...."
cat $file | sed 's/^M//g' > $file.new
echo "Done with $file"
mv $file.new $file
done

Watch the "mv $file.new $file" !

Only use this line if you are sure this is what you want
as it "REPLACES" the Original file.

There are about a bzillion ways, but this one
is "off the cuff".

Rick
On Wed, 17 Jun 1998, Sim Robert wrote:

> Hi there,
> 
> After  I transferred some text files from DOS to Linux, I discovered 
> that there is a <cr> or ^M after each line. How do I remove those 
> <cr> quickly, instead of doing so one by one.
> 
> Thanks.
--
Rick L. Mantooth        [EMAIL PROTECTED]
http://www.why.net/users/rickdman/index.html
We have enough youth, how about a fountain of "Smart."


-- 
  PLEASE read the Red Hat FAQ, Tips, Errata and the MAILING LIST ARCHIVES!
http://www.redhat.com/RedHat-FAQ /RedHat-Errata /RedHat-Tips /mailing-lists
         To unsubscribe: mail [EMAIL PROTECTED] with 
                       "unsubscribe" as the Subject.

Reply via email to