in reply to Re: Creating One Table From Several Hashes
in thread Creating One Table From Several Hashes

Thanks for the help. This does exactly what I needed. However, I think I was mistaken about the way I wanted the output structured. I am analyzing the FEC data set for individual campaign contributions, which has approximately 1.2 million entries. When I attempted to use your code to parse the file it became overwhelming very quickly. Given that, I am going to change the desired output table, to weeks instead of days.

So it looks something like this:

ZIP, WEEK1 (CANDID 1234), WEEK2 (CANDID 4567)...
64521, 500, 400, ...

Where WEEK1 (CANDID 1234) = the total money donated to that
candidate from each zip code for that week. I will toy around with this some this weekend and I may post again in the future.

Thanks again for all the help!

  • Comment on Re^2: Creating One Table From Several Hashes

Replies are listed 'Best First'.
Re^3: Creating One Table From Several Hashes
by ikegami (Patriarch) on Feb 26, 2009 at 03:39 UTC
    Easy! After
    my ($zip, $amt, $date, $candid) = split;
    just add
    $date = days_to_week($date);

    Writing days_to_week is left as an exercise for the reader :) (I'd use DateTime.)