#!/usr/bin/perl
open(tempfile,"<u028lschpmvbdhrlt.cir");
open(h2,">temp.cir");
while(<tempfile>){
chop $_;
@ary=split(" ",$_);
if (($ary[0] eq ".subckt") || ($ary[0] eq ".SUBCKT"))
{
$cell_name = $ary[1] ;
#rename("temp.cir",$cell_name.".cir");
#open(h2,">temp.cir");
}
print h2 $_;
print h2 "\n";
if (($ary[0] eq ".ends") || ($ary[0] eq ".ENDS"))
{
close(h2);
rename("temp.cir",$cell_name.".cir");
open(h2,">temp.cir");
}
}
close (tempfile);
close (h2);