This question is asked many times in similar forms...is there a perlfaq for this? If not, we need to look into submitting one. ----- Original Message ----- From: <[EMAIL PROTECTED]> To: "Joyce Harris" <[EMAIL PROTECTED]> Cc: "Perl" <[EMAIL PROTECTED]> Sent: Wednesday, January 09, 2002 11:18 AM Subject: Re: ^M's in file
> > Unix comes with the "dos2unix" and "unix2dos" commands (or scripts) that > takes care of the ^M problem. > If you do not have dos2unix, you could use sed or vi. > > In sed: > -------- > > sed 's/^M//' {infile} > {outfile} > > where ^M is created by > holding down the Ctrl and press the character v key followed by > the character m key > > > PS: m and v implies lower case m and lower case v. > > > That is: > fofmx1:/william/spool(23)% cal > a; unix2dos a b; cat -tev a b > January 2002$ > S M Tu W Th F S$ > 1 2 3 4 5$ > 6 7 8 9 10 11 12$ > 13 14 15 16 17 18 19$ > 20 21 22 23 24 25 26$ > 27 28 29 30 31$ > $ > January 2002^M$ > S M Tu W Th F S^M$ > 1 2 3 4 5^M$ > 6 7 8 9 10 11 12^M$ > 13 14 15 16 17 18 19^M$ > 20 21 22 23 24 25 26^M$ > 27 28 29 30 31^M$ > ^M$ > > fofmx1:/william/spool(25)% sed 's/^M//' b > c ; cat -tev c > January 2002$ > S M Tu W Th F S$ > 1 2 3 4 5$ > 6 7 8 9 10 11 12$ > 13 14 15 16 17 18 19$ > 20 21 22 23 24 25 26$ > 27 28 29 30 31$ > > > In vi > ------ > > Go into command mode (i.e., Esc, Shift :) > Then enter > > :1,$s/^M// > > Where ^M => holding down the Ctrl and press the character v key followed > by > the character m key > > __________________ > > William Ampeh (x3939) > Federal Reserve Board > > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]