in reply to Report Formatting Help

First you want to gather the information into a structure suitable for output. You want to output, for every product, quantity by rep. So, let's store it that way:
my %products; for (@lines) { chomp; next unless my ($rep, $prod, $qty) = $_ =~ /(\w+)\s+(\w+)\s+(\d+)/; $product{$prod}{$rep} += $qty; }
Now you have a two-level hash of the data. At this point, I would suggest using Text::Table to produce the output. Failing that, it's really just: foreach product, foreach column, "print spaced out columns"
rjbs

Replies are listed 'Best First'.
Re^2: Report Formatting Help
by Anonymous Monk on Jul 14, 2004 at 03:10 UTC
    hello again, Thank you for the help...but I had this part figured...I could put the code till the hash myself...I need help with how to represent the hash.