Simon336697
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.
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/
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
ozo...that was exactly what i was looking for.