Re: Stupid Question: Striping Dos ^M From Texts
>Somewhere in the dank recesses of my mind, I recall >a utility that would strip the extra ^M's from a >text file copied to a unix box. Well, it seems that >Linux also considers these ^M's extranious, is there >such a standard utility or do I have to dig even >deeper to remember sed/awk/grep commands? :^> dos2unix (in package sysutils) --- Benoit Goudreault-Emond Reply to: [EMAIL PROTECTED] My opinions are mine only and may not reflect those of my employer. E-mail me to obtain my public PGP key. -- TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to [EMAIL PROTECTED] . Trouble? e-mail to [EMAIL PROTECTED] .
Re: Stupid Question: Striping Dos ^M From Texts
On Thu, 5 Jun 1997, Curt Howland wrote: > Somewhere in the dank recesses of my mind, I recall a utility that > would strip the extra ^M's from a text file copied to a unix > box. Well, it seems that Linux also considers these ^M's extranious, > is there such a standard utility or do I have to digeven deeper to > remember sed/awk/grep commands? :^> dos2unix infile > outfile or: fromdos infile > outfile or: tr -d "\013" (in csh clones, it seems like \013 works ; but you may also try Ctrl-V Ctrl-M). Vadik. -- Vadim Vygonets * [EMAIL PROTECTED] * [EMAIL PROTECTED] * Unix admin The fish doesn't think, because the fish knows... everything. -- Arizona Dream -- TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to [EMAIL PROTECTED] . Trouble? e-mail to [EMAIL PROTECTED] .
Re: Stupid Question: Striping Dos ^M From Texts
-BEGIN PGP SIGNED MESSAGE- On Thu, 5 Jun 1997, Curt Howland wrote: > Somewhere in the dank recesses of my mind, I recall > a utility that would strip the extra ^M's from a > text file copied to a unix box. Well, it seems that > Linux also considers these ^M's extranious, is there > such a standard utility or do I have to dig even > deeper to remember sed/awk/grep commands? :^> The sysutils package contains the dos2unix (and unix2dos) commands which will convert files in-place. No need for wierd sed/awk/perl constructs. ++ || Your friends will know you better in the | | Scott K. Ellis | first minute you meet than your acquaintances | | [EMAIL PROTECTED] | will know you in a thousand years.| ||-- Illusions | ++ -BEGIN PGP SIGNATURE- Version: 2.6.3 Charset: noconv iQCVAwUBM5eDe6Ck2fENdzpVAQHT+QQAjMKFjofDJ8SPB876ezZsyagkCdgLF7c+ RuL/dapLEZyvdQyB0w7Gjn/edBbgLJ9iD3MWp/yPWz2K13WuWBtl88jqNAGwlTtS bya6ScoioLg8QrdkexBcxcYfGaekIKwM+PnL0dk3a99S1V+BFJh/5xYkfiVvePcj ubAqzRYq5+0= =czIV -END PGP SIGNATURE- -- TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to [EMAIL PROTECTED] . Trouble? e-mail to [EMAIL PROTECTED] .
Re: Stupid Question: Striping Dos ^M From Texts
On Thu, 5 Jun 1997, Curt Howland wrote: > > Somewhere in the dank recesses of my mind, I recall > a utility that would strip the extra ^M's from a > text file copied to a unix box. Well, it seems that > Linux also considers these ^M's extranious, is there > such a standard utility or do I have to dig even > deeper to remember sed/awk/grep commands? :^> try the program fromdos. Regards, =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Andre M. Varon Lasaltech, Incorported Technical Head Fax-Tel: (034)433-3520 e-mail : [EMAIL PROTECTED] web page: http://www.lasaltech.com/andre.html =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -- TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to [EMAIL PROTECTED] . Trouble? e-mail to [EMAIL PROTECTED] .
Re: Stupid Question: Striping Dos ^M From Texts
Here's a sed script that I've used for years on my old SCO Unix box. I'm not actually positive it works on Linux because I haven't tried it, but sed is sed, right?... It adds ^M's if they're missing and deletes them if found. (i.e. one script that will do both conversions) sed -e ' s-^M--g t s+$+^M+ t ' < infile > outfile One caveat -- infile and outfile **can't** be the same. Later, Kevin Traas Systems Analyst Edmondson Roper CA http://www.eroper.bc.ca -- TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to [EMAIL PROTECTED] . Trouble? e-mail to [EMAIL PROTECTED] .
Re: Stupid Question: Striping Dos ^M From Texts
Dale Scheetz: > The seesat5 package (a satellite tracking program) provides a little > program called "cr" that will convert text files from DOS style carriage > returns to Unix ones and back. Seesat5 needs the facility to incorporate > DOS generated element files on the Linux file system without the extra ^M > which causes problems for seesat5. Gee, it's amazing how many of these programs debian has! The sysutils package contains "fromdos" and "todos", which do what you'd probably expect with the carriage returns. "dos2unix" and "unix2dos" are alternate names for the same programs. -- see shy jo -- TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to [EMAIL PROTECTED] . Trouble? e-mail to [EMAIL PROTECTED] .
Re: Stupid Question: Striping Dos ^M From Texts
Curt Howland wrote: > > Somewhere in the dank recesses of my mind, I recall > a utility that would strip the extra ^M's from a > text file copied to a unix box. Well, it seems that > Linux also considers these ^M's extranious, is there > such a standard utility or do I have to dig even > deeper to remember sed/awk/grep commands? :^> cat file1 | tr -d '\r' > file2 -- Jens B. Jorgensen [EMAIL PROTECTED] -- TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to [EMAIL PROTECTED] . Trouble? e-mail to [EMAIL PROTECTED] .
Re: Stupid Question: Striping Dos ^M From Texts
tr -d '\r' < dosfile > unixfile removes all ^Ms, even if they are not at the end of the line where MSDOS seems to put them. tr(1) is small and fast. perl -p -i.bak -e 's/\r$//;' dosfile renames the dosfile dosfile.bak and writes the corrected output in dosfile. The $ "anchors" the search pattern to the end of the line. Omit the "-i.bak" if you don't want to save the old file. Cameron http://www.rahul.net/cameron/homepage.shtml -- TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to [EMAIL PROTECTED] . Trouble? e-mail to [EMAIL PROTECTED] .
Re: Stupid Question: Striping Dos ^M From Texts
On Thu, 5 Jun 1997, Curt Howland wrote: > > Somewhere in the dank recesses of my mind, I recall > a utility that would strip the extra ^M's from a > text file copied to a unix box. Well, it seems that > Linux also considers these ^M's extranious, is there > such a standard utility or do I have to dig even > deeper to remember sed/awk/grep commands? :^> > The seesat5 package (a satellite tracking program) provides a little program called "cr" that will convert text files from DOS style carriage returns to Unix ones and back. Seesat5 needs the facility to incorporate DOS generated element files on the Linux file system without the extra ^M which causes problems for seesat5. Luck, Dwarf -- _-_-_-_-_-_- _-_-_-_-_-_-_- aka Dale Scheetz Phone: 1 (904) 656-9769 Flexible Software 11000 McCrackin Road e-mail: [EMAIL PROTECTED] Tallahassee, FL 32308 _-_-_-_-_-_- If you don't see what you want, just ask _-_-_-_-_-_-_- -- TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to [EMAIL PROTECTED] . Trouble? e-mail to [EMAIL PROTECTED] .
Re: Stupid Question: Striping Dos ^M From Texts
In message <[EMAIL PROTECTED]>, writes: > >Somewhere in the dank recesses of my mind, I recall >a utility that would strip the extra ^M's from a >text file copied to a unix box. Well, it seems that >Linux also considers these ^M's extranious, is there >such a standard utility or do I have to dig even >deeper to remember sed/awk/grep commands? :^> In vi: :/g/^V^M$/s/// (where ^V means control-V) or, again in vi: :1,$s/.$// or, in ed or sed: 1,$s/.$// if you are sure that _every_ line ends with an unwanted character. It seems simpler than installing a special utility. I expect perl or awk would also offer entertaining solutions! If you copy from a mounted msdos filesystem, or ftp in ascii mode, you avoid the problem in the first place. -- Oliver Elphick[EMAIL PROTECTED] Isle of Wight http://homepages.enterprise.net/olly In case of connection troubles, try [EMAIL PROTECTED] instead. -- TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to [EMAIL PROTECTED] . Trouble? e-mail to [EMAIL PROTECTED] .
Re: Stupid Question: Striping Dos ^M From Texts
install the 'recode' package and use it like this : recode ibmpc:latin1 YourTextFile Bye, Alexandre On Thu, 5 Jun 1997, Curt Howland wrote: > > Somewhere in the dank recesses of my mind, I recall > a utility that would strip the extra ^M's from a > text file copied to a unix box. Well, it seems that > Linux also considers these ^M's extranious, is there > such a standard utility or do I have to dig even > deeper to remember sed/awk/grep commands? :^> > > Curt- > > > > -- > TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to > [EMAIL PROTECTED] . > Trouble? e-mail to [EMAIL PROTECTED] . > -- TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to [EMAIL PROTECTED] . Trouble? e-mail to [EMAIL PROTECTED] .
Stupid Question: Striping Dos ^M From Texts
Somewhere in the dank recesses of my mind, I recall a utility that would strip the extra ^M's from a text file copied to a unix box. Well, it seems that Linux also considers these ^M's extranious, is there such a standard utility or do I have to dig even deeper to remember sed/awk/grep commands? :^> Curt- -- TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to [EMAIL PROTECTED] . Trouble? e-mail to [EMAIL PROTECTED] .