LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Processing Timebased values (https://www.linuxquestions.org/questions/linux-general-1/processing-timebased-values-923847/)

amit.naudiyal 01-15-2012 12:44 AM

Processing Timebased values
 
Hi All,

I have a list of timebased values in below form:

20/Dec/2011:10:16:29 9
20/Dec/2011:10:16:30 13
20/Dec/2011:10:16:31 13
20/Dec/2011:10:16:32 9
20/Dec/2011:10:16:33 13
20/Dec/2011:10:16:34 14
20/Dec/2011:10:16:35 6
20/Dec/2011:10:16:36 7
20/Dec/2011:10:16:37 16
20/Dec/2011:10:16:38 5
20/Dec/2011:10:16:39 7
20/Dec/2011:10:16:40 15
20/Dec/2011:10:16:41 12
20/Dec/2011:10:16:42 13
20/Dec/2011:10:16:43 11
20/Dec/2011:10:16:44 6
20/Dec/2011:10:16:45 7
20/Dec/2011:10:16:46 9
20/Dec/2011:10:16:47 14
20/Dec/2011:10:16:49 6
20/Dec/2011:10:16:50 11
20/Dec/2011:10:16:51 15
20/Dec/2011:10:16:52 10
20/Dec/2011:10:16:53 16
20/Dec/2011:10:16:54 12
20/Dec/2011:10:16:55 8
20/Dec/2011:10:16:56 12
20/Dec/2011:10:16:57 7
20/Dec/2011:10:16:58 9
20/Dec/2011:10:16:59 14
20/Dec/2011:10:17:00 10
20/Dec/2011:10:17:01 11
20/Dec/2011:10:17:02 9
20/Dec/2011:10:17:03 10
20/Dec/2011:10:17:04 11
20/Dec/2011:10:17:05 9
20/Dec/2011:10:17:06 13
20/Dec/2011:10:17:07 12
20/Dec/2011:10:17:08 10
20/Dec/2011:10:17:09 11
20/Dec/2011:10:17:10 14


Second column contains value against each second. Values are there for complete month and for each and every second. I want to add these values -
Per minute basis. [for 00 - 59 seconds ]
Per hour basis [ for 00 - 59 minutes ]
Per Day basis. [ for 0 - 24 hours ]

Please help.

mpapet 01-15-2012 02:01 AM

Lots of ways to do this.

You can do it all in Perl with a flat file. This would take some coding to get all the dates into date objects and then sum from there. Not much, but some.
You can dump the data into a database table (using Perl???) run queries (using Perl???) to get your results. This way SQL does most of your time/date stuff for you.

Perl has very strong text handling abilities. The most "Linux compatible" Perl for Microsoft products is Strawberry Perl.

Python might do you okay too. It just depends on what your strengths are.

I'm not going to do your homework though...

amit.naudiyal 01-16-2012 07:32 PM

Thanks for your post mpapet. I did it through using - awk/grep in bash shell.
Can you brief me to input this data on SQL and retrieving it ?


All times are GMT -5. The time now is 02:29 PM.