On 04/18/2011 09:50 PM, googler wrote:
I have a few lines as below. Most of the lines below correspond to a
number (starting from 001 and counting upward). I want to change the
part "-new_cell_name ${eco_prefix}_001 " in each line to its
corresponding number without having to go to each line and type it

insert_buffer -new_net_name ${eco_prefix}_net_001 -new_cell_name $
{eco_prefix}_001 ...
insert_buffer -new_net_name ${eco_prefix}_net_002 -new_cell_name $
{eco_prefix}_001 ...

I'd just do a substitute across the lines so that you snag the first number and replace it as the second number. Something like


:%s/${eco_prefix}_net_\(\d\d\d\) -new_cell_name ${eco_prefix}_\zs\d\d\d/\1

The "\zs" makes the replacement start at that point, and the "\(...\)" captures the first portion to be used in the replacement "\1".

-tim





--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Reply via email to