Re: how to get rid of ^M character using vi

2004-01-26 Thread Jerry McAllister
how do i get rid of this annoying character ^M using vi, in pico i used the arguments '-w' but what about in vi? Those are extra carriage return characters generally displayed as CR or ^M or \r depending on which programmers convention is being used. There are lots of ways to strip then

Re: how to get rid of ^M character using vi

2004-01-25 Thread Kent Stewart
On Sunday 25 January 2004 01:43 am, marlon corleone wrote: how do i get rid of this annoying character ^M using vi, in pico i used the arguments '-w' but what about in vi? starting on the 1st line type :.,$s/ctrlvctrlm// The .,$ tells it to process from the current line to the last one.

Re: how to get rid of ^M character using vi

2004-01-25 Thread Avijit Pathania
Looks like your file might have been edited in a dos text editor. You can try running dos2unix against it to see if that helps. marlon corleone wrote: how do i get rid of this annoying character ^M using vi, in pico i used the arguments '-w' but what about in vi? cheers

Re: how to get rid of ^M character using vi

2004-01-25 Thread Bernard El-Hagin
Kent Stewart [EMAIL PROTECTED] wrote: On Sunday 25 January 2004 01:43 am, marlon corleone wrote: how do i get rid of this annoying character ^M using vi, in pico i used the arguments '-w' but what about in vi? starting on the 1st line type :.,$s/ctrlvctrlm// The .,$ tells it to process from

Re: how to get rid of ^M character using vi

2004-01-25 Thread Dan Welch
On Sun, Jan 25, 2004 at 09:43:21AM +, marlon corleone wrote: how do i get rid of this annoying character ^M using vi, in pico i used the arguments '-w' but what about in vi? This colon (ed) command works in FreeBSD's included vi's command mode: :%s/^M//g followed by pressing Enter. The

Re: how to get rid of ^M character using vi

2004-01-25 Thread Greg Wooledge
If *every* line ends with ^M (which is almost always going to be the case, if the file has been produced on a DOS/Windows system), then you can just use this: :%s/.$// to delete the last character of each line. This has an obvious downside, but the advantages are that it's easier to type and to

Re: how to get rid of ^M character using vi

2004-01-25 Thread Eric Dyer
One thing that works from the command line too col -bx oldfile newfile mv newfile oldfile Picked that up from a freebsd box that had a freebsd-tips or something like that fortune file running on login At 09:27 AM 1/25/2004, Greg Wooledge wrote: If *every* line ends with ^M (which is almost

Re: how to get rid of ^M character using vi

2004-01-25 Thread Albert Vest
On Sun, 25 Jan 2004 05:02:51 -0500 Avijit Pathania [EMAIL PROTECTED] wrote: Looks like your file might have been edited in a dos text editor. You can try running dos2unix against it to see if that helps. Looks like a jump to conclusions. I find the same artifact every time I run script

RE: how to get rid of ^M character using vi

2004-01-25 Thread Dom De Vitto
Try: :1,$sX^V^MX?? Where '^' means 'control', e.g. ^V is control-V, ^M is control-M. Control-V can be used to enter any non-printable ascii character. Easy when you know. Dom PS. the same magic works outside of VI, with sed. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -