#! /usr/bin/perl -w
my $file="log";
my $outfile="new";
my @content;
open FH,"<$file"or die "Cannot open $file !\n";
while(<FH>){
chomp;
if(/^\.subckt/){
push (@arry,$_ . " VDD VSS\n");
} elsif (/^m.*w=(.*)/){
push (@arry,$_ . "fw=$1 \n");
} else {
push (@arry,$_."\n");
}
}
close FH;
open FH,">$outfile" or die "Cannot open $outfile !\n";
print FH @arry;
close FH; |