how to replace special character in a file

how to replace special character in a file

Post by Lai Lye Khen » Sat, 14 Jun 1997 04:00:00



Hi,

I want to get rid of the " " in a file.  I vi the file and use
"g/ /s///g" and it doesn't work.  I have tried putting in "\" before the
special character but it still doesn't work. Anybody know how to solve
this?

Regards,
Lai

 
 
 

how to replace special character in a file

Post by Bill Tott » Mon, 16 Jun 1997 04:00:00




Quote:>I want to get rid of the "^]" in a file.  I vi the file and use
>"g/^]/s///g" and it doesn't work.  I have tried putting in "\" before the
>special character but it still doesn't work. Anybody know how to solve
>this?

You are substuting nothing for nothing every time you find an occurance
of '^]'. Try this in vi(of course '^]' is used to denote the group
separator character):

:%s/^]//g
--
Totten, William David (Bill)         Computer and Information Science Major

http://pobox.com/~totten/               Friends don't let friends use emacs

 
 
 

how to replace special character in a file

Post by Srinivasa Ra » Tue, 17 Jun 1997 04:00:00


in vi-editor to get rid of all those escape (^[) characters you
mentioned I would do the following, invoke vi editor and load the file
into it then

:s/^[//g <ENTER>

to get that ^[ I type CNTRl-V [

hope that will work for you


Quote:> Hi,

> I want to get rid of the " " in a file.  I vi the file and use
> "g/ /s///g" and it doesn't work.  I have tried putting in "\" before the
> special character but it still doesn't work. Anybody know how to solve
> this?

> Regards,
> Lai

--

-srinu-