i have two modules.txt files
module1.txt
module2. txt
i have to comare the conents of files and i have to print the output as folls
module1 module2
.COMPENSATION ( "ZHOLD" ), .COMPENSATION ("EXTERNAL" ),
.CLKIN1_PERIOD ( 5 ), .CLKIN1_PERIOD ( 5.000000 ),
i want the differences to be printed like that
but i was unable
the code i have developed is
module1.txt
module2. txt
i have to comare the conents of files and i have to print the output as folls
module1 module2
.COMPENSATION ( "ZHOLD" ), .COMPENSATION ("EXTERNAL" ),
.CLKIN1_PERIOD ( 5 ), .CLKIN1_PERIOD ( 5.000000 ),
i want the differences to be printed like that
but i was unable
the code i have developed is
Code:
my @codes1 = split /\./, $modcode_from_1;(text in module1)
my @codes2 = split /\./, $modcode_from_2;(text in module2)
print "\t\t****************THE DIFFERENCES IN THE FILES ARE AS FOLLOWS****************\n\n\n";
printf "\t\t\t%-45s %s\n\n\n", $filename1, $filename2;
my $i = 0;
foreach (@codes1) {
unless ($codes1[$i] eq $codes2[$i]) {
printf "\t%-45s is not the same as %s\n\n", $codes1[$i], $codes2[$i];
}
$i++;
}
Comment