Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do i remove the ^M^M's from my file? 5

Status
Not open for further replies.

farley99

MIS
Feb 12, 2003
413
US
I copied a file from windows to linux and it is filled with ^M^M's
How do i remove the ^M^M's from my file?

Can i do it with a search and replace?
 
When I'm editing on the command line, I use joe.

In joe, when you are entering a search term and hit backtick ("`", to the left of the "1" key on my keyboard), joe asks you for the ASCII code for a character rather than a character ("``" will search for a backtick). I tell it "013" then replace it with nothing.

Want the best answers? Ask the best questions: TANSTAAFL!!
 
run dos2unix on the file on the linux box.


>---------------------------------------Lawrence Feldman
SR. QA. Engineer SNAP Appliance
lfeldman@snapappliance.com

 
Just ftp the file over again using ASCII mode. If you don't have it on the Windows box, ftp it back in binary mode and then ftp it to unix in ASCII mode.

IBM Certified Confused - MQSeries
IBM Certified Flabbergasted - AIX 5 pSeries System Administration
MS Certified Windblows Rebooter
 
Thanks....
i used this method.....
vi <your file name>
When you are in the file issue a colon :))then enter the following like this

:g/^M/s// /g

To get the ^M use the control + V and m simultainously.
 
Why is it...
:g/^M/s// /g

Shouldn't it be
:%s/^M/ /g
?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top