You can use sed command.
Suppose you have your text in the file "test" as follows:
^M                                          ^Maaaa
^M                                          ^Mbbbb
^M                                          ^Mcccc
Then,use the foll. command:
cat test|sed 's/\^M//g'

Take care of the "\" (backspace) before ^M .Usage of  "g" means replacement for all ^M 
characters found on the same
line also.
"s" means substitute ^M with nothing.

man sed
for more info on usage of sed command.

Cheers,
Vineeta

Kiran Kumar M wrote:

> That can be done, but I want to do it by using a command. Thanks, Anyway I
> got it.
>
> Kiran
>
> On Tue, 13 Feb 2001, Anthony E . Greene wrote:
>
> > 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.
> >
> >
>
> _______________________________________________
> Redhat-list mailing list
> [EMAIL PROTECTED]
> https://listman.redhat.com/mailman/listinfo/redhat-list



_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to