Computing.Net > Forums > Unix > remove ^M from a file

remove ^M from a file

Reply to Message Icon

Original Message
Name: Najib (by Nael_Najib)
Date: August 18, 2006 at 12:18:47 Pacific
Subject: remove ^M from a file
OS: Solaris
CPU/Ram: 512m
Model/Manufacturer: Sun
Comment:

Hello,

i wonder how do i remove ^M from above 40 file that comes under a directory and subdirectories.

i usually vi the file and user :%s/^M//g

but for such many files.. it is tedious to do.

thanks

Aladimi


Report Offensive Message For Removal


Response Number 1
Name: nails
Date: August 18, 2006 at 12:44:39 Pacific
Reply: (edit)

There's always the dos2unix tool, but if you want a shell solution, take a look at this link:

http://www.tek-tips.com/faqs.cfm?fid=1911


Report Offensive Follow Up For Removal







Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: remove ^M from a file

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software




Have you ever used OpenOffice?

Yes, as my main suite.
Yes, occationally.
Yes, but only once.
No, never.


View Results

Poll Finishes In 5 Days.
Discuss in The Lounge