[Ilugc] Help on Vi Editor

  • From: shivanan@xxxxxxxxxxxxxxxxx (Haran Shivanan)
  • Date: Tue Mar 15 06:28:13 2005

On Mon, 2005-03-14 at 18:37 +0000, RAJ wrote:

I think this is possible with vi editor , do anyone know how do i do
it.
As others have pointed out, this is easy to do without vi, but since you
asked, you could just use a macro.
Go to the first line in command mode and type
@qA@xxxxxxxxxxxx<Esc>j^q

(Replace @whatever.com with whatever domain name you want)
Then:
<Esc>:50@q
To apply the change to all lines
(where "50" is the number of remaining lines in the file)

Not as easy in this case as using cat or sed but this is, in-general a
useful technique when editing in vi

See :help q for more details.


-- 
"The price of correctness is eternal vigilance"
- Thomas Jefferson


Other related posts: