in reply to Parse File Containing Multiple Batches With Correlating Detail Records

Or...

my $fh = new FileHandle($fileName,">"); if (! defined $fh) { print STDERR "Error reading $fileName\n"; exit(2); } my ($bh,$fh,$ft); while (my $line = <$fh>) { chomp($line); if ($line =~ /^BH/) { $bh = $line; } elsif ($line =~ /^(F[HT])/) { eval("\$" . lc($1) . " = $line"); next; } elsif (defined $bh) { callSub($line,$bh); } } close($fh);

print(map(lc(chr),split(6,qw/99672682673683684689632658645641610607/)));
  • Comment on Re: Parse File Containing Multiple Batches With Correlating Detail Records
  • Download Code