Link to home
Start Free TrialLog in
Avatar of Simon336697
Simon336697Flag for Australia

asked on

Search and Replace in Vi Editor

Hi guys hope you can help me :>)

I have a question on using VI Editor.

I often want to do search and replacements in a text file, and use VI to do this.

For example,

:1,$s/MindMaps/Algorithms

What the above does is to find all instances of MindMaps, and replace it with Algorithms.

What Im having trouble with is the following...

:1,$s/MindMaps/Algorithms/002/text

In the above, I want to replace the word

MindMaps

with

Algorithms/002/text

What I get is an error in VI Editor saying "Trailing characters"

Q. How do I do a replacement in Vi with forward slashes included in the replacement?

Thank you.
ASKER CERTIFIED SOLUTION
Avatar of ozo
ozo
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Simon336697

ASKER

Guys thanks for that :>)

ozo...that was exactly what i was looking for.