- 论坛徽章:
- 145
|
回复 1# minzyyl
$ cat conf.txt
VSS DIRECTION INPUT
VSS USE GROUND
VDD DIRECTION INPUT
VDD USE POWER
$ awk 'FNR==NR{if(NF==3){a[$1,$2]=$3;next}}{if($1=="PIN")NAME=$2;if(a[NAME,$1])sub($1" +[^ ;]+",$1" "a[NAME,$1])}1' conf.txt a.txt
VERSION 5.7 ;
BUSBITCHARS "[]" ;
DIVIDERCHAR "/" ;
MACRO aon211d1V5
ORIGIN 0 0 ;
FOREIGN aon211d1V5 0 0 ;
SIZE 7.6 BY 14.6 ;
PIN VSS
DIRECTION INPUT ;
USE GROUND ;
PORT
LAYER A1 ;
RECT 0 0 7.6 1.8 ;
END
END VSS
PIN A
DIRECTION INPUT ;
USE SIGNAL ;
PORT
LAYER A1 ;
RECT 4.9 4.75 5.8 6.8 ;
END
END A
PIN VDD
DIRECTION INPUT ;
USE POWER ;
PORT
LAYER A1 ;
POLYGON 3.35 8.45 4.4 8.45 4.4 8.35 4.55 8.35 4.55 7.45 3.45 7.45 3.45 7.55 3.35 7.55 ;
END
END B
|
|