in reply to data manipulation
Original data:open OUT, ">$Output_Directory/sitescope.dat" or die "Can't open OUTPUT + file: $!"; foreach (@data) { $counter++; @tmp = split(/\t/); ($time,$date) = split(/ /,$tmp[0]); $date =~ s/2003/03/g; $time = substr($time,0,5); $mday = substr($date,3,2); ($hour,$min) = split(/:/,$time); $mod = int($min/5); if ($mod != $last_mod) { print OUT "$last_date\.$last_time\t"; foreach (1..5) { $seconds = $seconds{$_}/$counter; printf OUT "%1.2f\t",$seconds; $seconds{$_}=0; } print OUT "\n"; $counter=0; } foreach (@tmp[1..5]) { $place++; $seconds{$place} += ($_/1000); } $place=0; $last_mod = $mod; $last_date = $date; $last_time = $time; } close OUT;
08/08/03.07:55 1.61 1.158 0.71 0.209 0.535 08/08/03.07:57 1.094 0.887 0.96 0.126 0.322 08/08/03.07:59 5.131 0.986 1.029 0.095 0.251 08/08/03.08:01 1.071 1.274 0.638 0.197 0.347 08/08/03.08:03 1.166 0.984 0.598 0.092 0.583 Chunked data: 08/08/03.07:59 2.39 0.94 0.80 0.11 0.30 08/08/03.08:03 2.31 1.60 1.02 0.20 0.61
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: data manipulation
by Not_a_Number (Prior) on Aug 08, 2003 at 16:58 UTC | |
by Earindil (Beadle) on Aug 08, 2003 at 17:43 UTC |