For Programmers: Free Programming Magazines  


Home > Archive > PERL Beginners > August 2005 > Time Ranges









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Time Ranges
Noah

2005-08-30, 6:56 pm

Hi,

I been lurking here for a while, looking for the solution to a
particular problem. I have some data like the following.

GE,08/12/2005 15:39:17,a,b,c,d,e,f,g,h,i,j
GE,08/12/2005 15:39:22,a,b,c,d,e,f,g,h,i,j
GE,08/12/2005 15:40:17,a,b,c,d,e,f,g,h,i,j
GE,08/12/2005 15:41:16,a,b,c,d,e,f,g,h,i,j


I would like to create a "snapshot" of this data in a another file, for
each minute of a specified range. The criteria for the snapshot would
be to print data from the latest record of each minute. So above, at
15:39, I would get the 15:39:22 record.

A lot of other conditional processing will happen in the loop; I'm
really just interested in knowing how to lay this out in Perl. So far I
have looked at Date::Manip, Time::Piece, and others. I am able to
generate a range of dates, but not a range of minutes. Then the
question becomes, what kind of comparison to do? Array or hash?

I'm reaching out here because PHP did not cut it on the first go-round.
Is this thing on?


TIA,
Noah

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2009 codecomments.com