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

Greetings,

what about:

while(<>) { chomp; if(/^FT.*/) { $ft_flag ++; next; } if(/^FH.*/) { $fh_flag ++; next; } if($ft_flag) {...; next;} if($fh_flag) {...; next;} if(/^BH.*/) { $current_bh=$_; next; } if(^0006.*) { do_whatever_using($current_bh,$_); next; } }

Cheers,
alf
You can't have everything: where would you put it?
  • Comment on Re: Parse File Containing Multiple Batches With Correlating Detail Records
  • Download Code