Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
This code eats a text file and spits out values for each of the variables at one minute intervals, using UNIX time. The parsing is nice, this is the ugly bit - the output.
# Figure out the first timestamp foreach my $bar (sort keys %master) { $j = $bar; last; } # Figure out the last timestamp foreach my $bar (reverse sort keys %master) { $l = $bar; last; } do { my $out; $out .= "$j,"; $out .= $master{$j}{'CCMT'} || '0'; $out .= ","; $out .= $master{$j}{'CCOA'} || '0'; $out .= ","; $out .= $master{$j}{'CDEC'} || '0'; $out .= ","; $out .= $master{$j}{'CFST'} || '0'; $out .= ","; $out .= $master{$j}{'CREF'} || '0'; $out .= ","; $out .= $master{$j}{'CRSP'} || '0'; $out .= ","; $out .= $master{$j}{'CVEH'} || '0'; $out .= "\n"; print $out; $j += 60; } while $j <= $l;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Golf, Anyone? Stupid output questions
by VSarkiss (Monsignor) on Apr 17, 2002 at 02:38 UTC | |
|
Re: Golf, Anyone? Stupid output questions
by belg4mit (Prior) on Apr 17, 2002 at 02:34 UTC | |
|
Re: Golf, Anyone? Stupid output questions
by crazyinsomniac (Prior) on Apr 17, 2002 at 02:34 UTC | |
| A reply falls below the community's threshold of quality. You may see it by logging in. |