#!/usr/bin/perl
$fname=$ARGV[0] ;
$tname=$ARGV[1] ;
open(FILE1, "<$fname") or die "Error opening input: $fname\n\n" ;
while(<FILE1>)
{
$line1 = $_ ;
chomp $line1 ;
if ($print_ind eq 1)
{
print $line1 . "\n" ;
$lines = $lines . $line1 . '=' ;
}
if ($line1 =~ /^$tname/)
{
$print_ind = 1 ;
}
if (length($line1)==0)
{
$print_ind = 0 ;
}
}
@lines = split(/=/,$lines);
foreach $line (@lines)
{
#print $line . "\n" ;
($part1,$part2) = split('\|\|',$line) ;
print $part1 . ' === ' . $part2 . "\n" ;
}
close (FILE1);
|
|