home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!zephyr.ens.tek.com!tekig7!tekig5!naren
- From: naren@tekig5.pen.tek.com (naren)
- Newsgroups: comp.unix.questions
- Subject: Replacing words
- Message-ID: <6937@tekig7.PEN.TEK.COM>
- Date: 12 Sep 92 23:08:11 GMT
- Sender: news@tekig7.PEN.TEK.COM
- Distribution: usa
- Organization: Tektronix, Inc., Beaverton, OR.
- Lines: 23
-
- Hi,
-
- I was trying to replace occurrences of XXX with another word YYY.
- I was able to do it two ways.
-
- 1. I went into the vi editor.
- /XXX
- [ESC] cw
- Then I kept hitting n and .
-
- 2. I wrote a macro in vi.
- The basic structure was as follows.
- map v: /XXX cw YYY
-
- 3. I tried out a third one.
- This one did not work for some reason.
-
- :$s /XXX/YYY/g
-
- If anyone can come up with better ways, email me
-
- Naren
- email address: naren%tekig5.pen.tek.com@ucbvax.berkeley.edu
-