| Ed Morton 2005-02-04, 3:55 pm |
|
kubik wrote:
> Hi all!
> I'm an electronic engineer and i have a netlist in which I
> have to modify the gate lenght of the transistors. For being more specific
> a typical line that I have to modify is:
>
> M01 vdd i0 a_17_55# vdd p w=30u L=2u ad=190.909p pd=53.4545u as=90p
> ps=36u
>
> I must sum 0.3636 to the L parameter. The result must be
>
> M01 vdd i0 a_17_55# vdd p w=30u l=2.3636u ad=190.909p pd=53.4545u
> as=90p s=36u
>
> I have tried using sed:
>
> sed 's/\(l=\)\([0123456789.]\{5\}\)\(u\)/\1\2+0.3636\3/g'
>
> but the result is l=2.000+0.3636u
> Further the L parameter is max 5 digits but also only one ( like 2u ) and
> not 2.000u that i have used for my attempt.
>
> I hope that someone will help me!
I'm not 100% sure what you mean by your output formatting requirements
or what your range of expected inputs is. It's also not clear if the
"L=" field is always in the 8th column or if you need so search for it
but try this and come back if it doesn't do what you expected in general
and you can't figure out how to fix it:
gawk '{num=gensub("[^[:digit:].]","","g",$8)$8="L="num+0.3636"u"}1'
Regards,
Ed.
|