Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Report File Extract

by bv (Friar)
on Dec 09, 2009 at 19:02 UTC ( [id://812002]=note: print w/replies, xml ) Need Help??


in reply to Report File Extract

First, decide how you want to store your data. Then decide how to populate your data structure. I would do something along the lines of a dispatch table populating a hash, like so:

my %dispatch = ( 'SALES ' => \&do_sales_stuff, 'GROSS PROFIT $' => \&do_gpdollar_stuff, 'GROSS PROFIT %' => \&do_gppercent_stuff, 'AVG. SALES/RO ' => \&do_avgsales_stuff, 'TOTAL HOURS ' => \&do_hours_stuff, 'AVG. HOURS/RO ' => \&do_avghours_stuff, 'ETC, ETC, ETC ' => \&do_whatever, ); my $salesperson; my %data; while(<>) { my $rowid = substr $_, 0, 14; next if $salesperson = discard_header_or_get_new_salesperson($_); ($dispatch{$rowid} || \&unhandled stuff)->(\$data{$salesperson}, $_) +; }

@_=qw; Just another Perl hacker,; ;$_=q=print "@_"= and eval;

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://812002]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2024-04-24 09:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found