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.
LVL 1
Simon336697Asked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
ozoConnect With a Mentor Commented:
1,$s#MindMaps#Algorithms/002/text
0
 
Arthur_MinoConnect With a Mentor Commented:
G'day,

I think you'll need the grep command here

Check this link out
http://lowfatlinux.com/linux-sed.html

Cheers,
Arthur
0
 
amirs80Connect With a Mentor Commented:
:%s$MindMaps$Algorithms/002/text
there are many other tech , by using sed is also is a tech
0
 
Simon336697Author Commented:
Guys thanks for that :>)

ozo...that was exactly what i was looking for.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.