On Tue, 13 Feb 2001 07:48:10 Kiran Kumar M wrote:
> >I have a file with characters might be carriage returns. The file looks
> >like the following (I opened it in vi)
> >
> > ^M ^Maaaa
> > ^M ^Mbbbb
> > ^M ^Mcccc
> >
> >I want to convert to
> >
> >aaaa
> >bbbb
> >cccc
> >
> >I want to omit the extra characters..
>
> So open the file in vi/vim and use the "x" key to delete the unwanted characters,
>then "ZZ" to save and quit.
Yeah, but like if you have 20 pages of this in your vi screen...who
wants to do that?
I think if you vi your file and do:
ESC shift ! G sed -e 's/ctrlv controlm//g'
you will get what you want. This will replace each '^M'.
This is hard to describe, but holding down the control key and hitting
v, then hitting control m is the magic you need to find all the stupid
carriage returns in your file.
Hope it helps and does what you want!
Phil
_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list