[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: stripping the ^M



Cimarron Ryan wrote:
> 
> Just for kicks, I decided to try and strip the nasty ^M from windows/dos
> text files using sed.

You are reinventing the wheel.  There is a utility program
to do this, or the other way around.  Its called dos2unix
and unix2dos or something like that.  I could not find them
offhand, but I know they exist.  Usage is something like
this:

prompt# dos2unix dosfile.txt unixfile.txt

and it will create a new file called unixfile.txt that has the
^M stripped from it.  The otherone, unix2dos does the same
thing the other way: it ADDS the ^M for making DOS files out
of Unix ones.

These programs are available for both Unix and MSDOS.  Do a
bit of digging and you will find them.  I thought I could
find them for you off the bat, but I could not.  Maybe I have
the name slightly wrong.

-- 
Ramon Gandia ================= Sysadmin ================ Nook Net
http://www.nook.net                                  rfg nook net
285 West First Avenue                           tel. 907-443-7575
P.O. Box 970                                    fax. 907-443-2487
Nome, Alaska 99762-0970 ========== Alaska Toll Free. 888-443-7525



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]