OK, here is one way to do it:
print "=====================================\n");
print "| INBOUND TRACK 1 | INBOUND TRACK 2 |\n");
print "=====================================\n");
open my $IN1, "<", "inbndtrk1.txt" or die "could not open inbndtrk1.tx
+t" ;
open my $IN2, "<", "inbndtrk2.txt" or die "could not open inbndtrk2.tx
+t" ;
while (my $in1 = <$IN1>) {
chomp $in1;
$in1 = s/:/ /;
my $in2 = <$IN2>;
$in2 = s/:/ /;
print "$in1|$in2";
}
Note that you have a slight discrepancy between the header and the data: your code for the header uses three "|" symbols, but the output result that you are looking for does not. I'll leave it to you to sort out what you really want, but feel free to ask if you encounter any difficulty, or if you don't understand something from the above code. Also note that this is untested, as I have not real test data.
Update: Oops, stupid error on my part, thanks to AnomalousMonk for pointing out. The loop code should be:
while (my $in1 = <$IN1>) {
chomp $in1;
$in1 =~ s/:/ /;
my $in2 = <$IN2>;
$in2 =~ s/:/ /;
print "$in1|$in2";
}
|