Hi,
Starting with a file with two lines:

var1_$x; var2>$x-1
var3x; var4x==1

I would like to end up with the following seven line file:

var1_1; var2>1-1
var1_2; var2>2-1
var1_3; var2>3-1
var3_a; var4_a==1
var3_b; var4_b==1
var3_c; var4_c==1
var3_d; var4_d==1

How could I automate this procedure?

I was thinking of something of the following terms but I'm not sure how to
represent the "i" inside a for loop and whether the setline function is
called correctly (I'm new with VIM scripting):

let line=getline(",")
for i in range(1,3)
   let repl'i'=substitute(line,'\$x','i',"g")
endfor
call setline(.,line,repl1,repl2,repl3)???

Thanks,
Antonis

-- 
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