
ZamNeb
New User
Apr 8, 2009, 1:02 AM
Post #1 of 2
(240 views)
|
|
Summing and Aggregating
|
Can't Post
|
|
I am new to PERL and need help with some data I am working with. I have a data set that looks like this 0 4/2/2007 6:00:15 21615 62 2 2 4 1 4/2/2007 6:00:55 21655 60 2 2 4 2 4/2/2007 6:01:15 21675 65 20 3 4 3 4/2/2007 6:02:15 21735 62 2 2 4 4 4/2/2007 6:02:55 21775 60 2 2 4 5 4/2/2007 6:02:55 21775 65 20 3 4 6 4/3/2007 6:00:15 21615 62 2 2 4 7 4/3/2007 6:00:55 21655 60 2 2 4 8 4/3/2007 6:01:15 21675 65 20 3 4 9 4/3/2007 6:02:15 21735 62 2 2 4 10 4/3/2007 6:02:55 21775 60 2 2 4 11 4/3/2007 6:02:55 21775 65 20 3 4 I want to get the total of values in col 6 every 2-minutes / day. I also want to get the average values for cols 5 and 7 every 2-minutes per day. The final result should look like 0 4/2/2007 62.3 24 2.3 4 1 4/2/2007 62.3 24 2.3 4 2 4/3/2007 62.3 24 2.3 4 3 4/3/2007 62.3 24 2.3 4 Note: cols 3 and 4 are time in h:m:s and in secs respectively. Thus 6:00:00 (col3) is 21600 (col4). Thanks!
|