LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-15-2012, 12:44 AM   #1
amit.naudiyal
LQ Newbie
 
Registered: May 2010
Posts: 18

Rep: Reputation: 0
Smile 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.
 
Old 01-15-2012, 02:01 AM   #2
mpapet
Member
 
Registered: Nov 2003
Location: Los Angeles
Distribution: debian
Posts: 548

Rep: Reputation: 72
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...

Last edited by mpapet; 01-15-2012 at 02:03 AM.
 
Old 01-16-2012, 07:32 PM   #3
amit.naudiyal
LQ Newbie
 
Registered: May 2010
Posts: 18

Original Poster
Rep: Reputation: 0
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 ?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Text Processing brainAcid Linux - Newbie 21 05-20-2011 10:19 AM
help image processing Tushar Prithviraj Programming 3 02-20-2010 08:46 PM
Document processing youngri Linux - Software 2 01-18-2005 11:26 PM
PHP.. not processing? digitaloutsider Slackware 2 04-29-2004 07:45 PM
dual processing jonfa Linux - General 3 06-01-2001 08:08 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:35 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration