1753453 Members
6082 Online
108794 Solutions
New Discussion юеВ

Vi Editor

 
SOLVED
Go to solution
Joyce Suganthy
Advisor

Vi Editor

Hi Gurus,

Please help.

In the vi editor, how do i look for all "OM" word and replace it with "AN" from the beginning till the end of the file.?

Please help and thanks in advance.

Regards
3 REPLIES 3
melvyn burnard
Honored Contributor
Solution

Re: Vi Editor

try the folowing on the comand line for vi:

:1,$s/OM/AN/g

My house is the bank's, my money the wife's, But my opinions belong to me, not HP!
Joyce Suganthy
Advisor

Re: Vi Editor

thanks a lot for the help. it works
H.Merijn Brand (procura
Honored Contributor

Re: Vi Editor

There's a shorthand for '1,$': '%'

:%s/OM/AN/g

If you only want to change the *word* OM,

:%s/\/AN/g

Enjoy, have FUN! H.Merijn [ Still unable to use Opera ]
Enjoy, Have FUN! H.Merijn