Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'you can use vi too' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
you can use vi too
Authored by: iMike on Jan 04, '01 06:10:10AM

You can also use vi to replace the Mac line breaks using the following command:

:%s/^M/^M/g

NOTE: You will need to type shift+: to get to the colon prompt
in vi you can then enter the command starting with the % symbol.
The ^M actually maps to control+shift+v followed by control+shift+m
(+'s are not included), so in actuality the command looks like this:

:%s/control V control M/control V control M/g

Many thanks to my former Perl teacher for this one--
I used it a whole lot of times in my Perl class. 8^)

Mike



[ Reply to This | # ]
A way to do it with SED
Authored by: Anonymous on May 30, '01 10:48:43AM
sed 'y/^M/n/' filename  newfilename
To Enter the '^M' character: type Cntrl-V then Cntrl-M. HTH -Excalibur

[ Reply to This | # ]