[It's best to reply to the list so that others can contribute and learn.]

On 12/19/2003 12:11 PM, William Martell wrote:

OK.  What about the trash that the substring will collect from the headers
of the printed report?

I didn't look very closely before, but it looks like this report has multiline records. I don't have enough time right now to go into detail on this, but here are a few hints.


<DATA> for 1..12;
until (eof(DATA)) {

<DATA> for 1..2; # discard record header
my $acct = <DATA>; # break this into fields using substr()
last if $acct =~ /^GROUP TOTALS/; # this happens at the end of the main report


<DATA> for 1..2; # discard blank line and item header

  while (my $line = <DATA>) {
    last if $line =~ /^CUSTOMER TOTALS/; # this marks end of item detail
    # $line is item details, break with substr()
  }

my $total = <DATA>; # item totals

  <DATA> for 1..2; #discard more lines
}



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to