Rev 2 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
2 | mjames | 1 | #!/usr/bin/perl |
2 | # This version of add_ports is used only with EDIF files |
||
3 | |||
4 | #A component of the add-ports script, used to split an EDIF file |
||
5 | #somewhere in its interface list |
||
6 | |||
7 | $s = 0; |
||
8 | |||
9 | |||
10 | |||
11 | |||
12 | open(IN1, "<test.acf"); |
||
13 | #open(IN, "<test.edf"); |
||
14 | #open(OUT1, ">outp.edf"); |
||
15 | $entity=@ARGV[0]; |
||
16 | print "looking for '$entity'\n"; |
||
17 | $s=0; |
||
18 | $cnt = 0; |
||
19 | while( <IN1> ) { |
||
20 | if (/$entity/) { |
||
21 | $s=1; |
||
22 | break; |
||
23 | } |
||
24 | if($s==1 && /END;/) |
||
25 | { |
||
26 | $s=0; |
||
27 | break; |
||
28 | } |
||
29 | |||
30 | if( $s==1 && /(rsv[0-9]+z)/ ) { |
||
31 | @rsv[$cnt++] = $1; |
||
32 | } |
||
33 | } |
||
34 | |||
35 | for ($i=0;$i<$cnt;$i++) { |
||
36 | print @rsv[$i],"\n"; |
||
37 | } |