in reply to Parse CSV lines and process for each second
here's a pseudo-code-ish description of how you might approach this:
my $hash={}; while (have_records){ my $time = (date_from_record) . "-" . (time_from_record); if ( ! defined($hash->{$time} ) { $hash->{$time} = { min => SOME_VERY_LARGE_NUMBER, max => 0 } } $hash->{$time}->{min} = ( (VALUE_FROM_RECORD) < $hash->{$time} +->{min} ? (VALUE_FROM_RECORD) : $hash->{$time} +->{min} ) ; $hash->{$time}->{max} = ( (VALUE_FROM_RECORD) > $hash->{$time} +->{max} ? (VALUE_FROM_RECORD) : $hash->{$time} +->{max} ) ; } # NOTE: change (date_from_record), (have_records and other # psuedo-values to things that are reasonable.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Parse CSV lines and process for each second
by capriguy84 (Novice) on Sep 07, 2011 at 19:50 UTC | |
by blue_cowdawg (Monsignor) on Sep 07, 2011 at 20:21 UTC | |
by capriguy84 (Novice) on Sep 07, 2011 at 21:16 UTC | |
by davies (Monsignor) on Sep 07, 2011 at 22:04 UTC |