Earindil has asked for the wisdom of the Perl Monks concerning the following question:
08/07/03.22:55 TOT/3 TOT/3 TOT/3 TOT/3 TOT/3 08/07/03.23:00 TOT/2 TOT/2 TOT/2 TOT/2 TOT/2Every thing I've come up with/attemted has looked like a horrible mess/hack. Any suggestions on what I could do here would be highly appreciated.
. . . 08/07/03.22:55 1.029 1.172 1.03 0.086 0.382 08/07/03.22:57 0.829 2.284 1.219 0.087 0.439 08/07/03.22:59 2.437 0.792 0.809 0.087 0.305 08/07/03.23:01 0.653 1.089 0.541 0.116 0.351 08/07/03.23:03 0.823 2.407 0.826 0.04 0.23 08/07/03.23:05 0.797 1.016 0.619 0.195 0.274 08/07/03.23:07 1.742 0.901 1.078 0.087 0.328 08/07/03.23:09 0.897 1.218 0.512 0.096 0.252 08/07/03.23:11 1.146 1.281 0.521 0.086 0.276 08/07/03.23:13 0.924 1.129 0.891 0.4 0.456 08/07/03.23:15 1.103 1.383 1.645 0.09 0.387 08/07/03.23:17 0.86 2.078 1.098 0.635 0.36 08/07/03.23:19 3.832 1.911 0.808 0.086 0.309 . . .Here is the current code that is generating this data from the raw log file and not doing any 5 minute chunking.
open OUT, ">$Output_Directory/sitescope.dat" or die "Can't open OUTPUT + file: $!"; foreach (@data) { @tmp = split(/\t/); ($time,$date) = split(/ /,$tmp[0]); $date =~ s/2003/03/g; $time = substr($time,0,5); $mday = substr($date,3,2); $hour = substr($time,0,2); print OUT "$date\.$time\t"; foreach (@tmp[1..5]) { $seconds = $_/1000; print OUT "$seconds\t"; } print OUT "\n"; } close OUT;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: data manipulation
by japhy (Canon) on Aug 08, 2003 at 16:00 UTC | |
|
Re: data manipulation
by BrowserUk (Patriarch) on Aug 08, 2003 at 18:58 UTC | |
|
Re: data manipulation
by cfreak (Chaplain) on Aug 08, 2003 at 16:02 UTC | |
|
Re: data manipulation
by Earindil (Beadle) on Aug 08, 2003 at 16:23 UTC | |
by Not_a_Number (Prior) on Aug 08, 2003 at 16:58 UTC | |
by Earindil (Beadle) on Aug 08, 2003 at 17:43 UTC |