I need to replace following line:
[rescap] l=1.2u w=1.5u
by
[rescap] l=1.2u w=1.5u r=0.8k
value of r 0.8k is l/w
I am trying in vim (already done in perl but wanted to implement using vim)
:s/l=\\(.\*\\)u w=\\(.\*\\)u/l=\1u w=\2u r=\1*\2k/
but it does not evaluate expression and prints:
[rescap] l=1.2u w=1.5u r=1.2*1.5k
If I try \= which evaluates expression it assumes l and w as variable and throws out error.
:s/l=\\(.\*\\)u w=\\(.\*\\)u/\=l=\1u w=\2u r=\1*\2/
I have to run above expression using vim -s scriptfile through many files. just need to figure out the above substitution statement.