$dirname = "C:\\LVT_cells";
opendir(DIR, $dirname) or die "can't opendir $dirname: $!";
while (defined($file = readdir(DIR))) {
$dut = $dirname."\\".$file;
print $dut."\n";
open(h1, "<$dut");
open(h2, ">temp.cir");
while(<h1>){
chop $_;
print h2 $_;
print h2 "\n";
@ary=split(" ",$_);
if($ary[0] eq ".include"){
$write_back = $_;
print $write_back."\n";
}
if($ary[0] eq ".subckt"){
print h2 $write_back."\n";
print $write_back;
print "got it";
}
if($ary[0] eq ".ends"){
close(h2);
rename("temp.cir",$dut.".cir");
open(h2,">temp.cir");
}
}
}
closedir(DIR);
沒有留言:
張貼留言