|Perl Monk, Perl Meditation|
(Complex)Data Manipulationby rupesh (Hermit)
|on Feb 28, 2005 at 05:59 UTC||Need Help??|
rupesh has asked for the
wisdom of the Perl Monks concerning the following question:
Greetings! I seek the help of fellow monks once again. This is with regard to a friend of mine, who gave me a csv containing a database dump.
Below is a sample of the dump.
What is needed is a summary of the report on a monthly basis. This would help in analyzing import-sales ratio for every month. (There is a similar dump for sales. That is a simpler one which does not include the 'region' field.) Output monthly report should look like:
I've worked on this for more than a couple of hours now using hashes and makeing '$date_$product' as key and quantity as its value. Using more hashes to seperate the regions. I've also tried to write to temp files and re-creating them for each month.
Is there a simple way to get the whole thing done in a single loop?
I'd appreciate any comments/thoughts from you folks.