in reply to Re^3: Parse CSV lines and process for each second
in thread Parse CSV lines and process for each second


Thanks for writing up the long script and giving a new idea. I kind of understand now that you are using date-time as key and checking min & max and only then feeding in to the hash.

If I choose this route, I have to work on other columns(5 & 6) to calculate weighted mean, get first & last value of the each second. Along with that count the max occurrences of column 6. I was able to deduce all above operations using arrays and that is the reason why I was reluctant to change the scheme.

Btw, this is not a college assignment, I am working on some finance data to plot graphs.

Anyone else have other ideas?
  • Comment on Re^4: Parse CSV lines and process for each second

Replies are listed 'Best First'.
Re^5: Parse CSV lines and process for each second
by davies (Monsignor) on Sep 07, 2011 at 22:04 UTC

    I think the idea you have been given is just fine for your original problem. But if you want to do other things as well, as you now indicate, you should still stick with the hash. The point is what the hash contains. Each hash value can be a pointer to an array. This is frequently referred to as a "Hash of Arrays" or HoA. That way, you can keep as many statistics as you want in the array, with one array for each hash key. There's plenty of documentation on this data structure.

    Regards,

    John Davies