Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

Re: How to calculate earliest date from log file

by CountZero (Bishop)
on Nov 10, 2012 at 22:24 UTC ( #1003285=note: print w/replies, xml ) Need Help??

in reply to How to calculate earliest date from log file

If it is a real log file then the first entry should be the oldest and you can extract the date easily from the first line with a regex such as /(\d{2}\/.{3\/\d{4})}/


A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

My blog: Imperial Deltronics

Replies are listed 'Best First'.
Re^2: How to calculate earliest date from log file
by Anonymous Monk on Nov 10, 2012 at 23:15 UTC

    It's not though, its a sample file where all the data is mixed and matched, what I'm thinking is store the date somewhere and have the while loop check it each time to the date in the loop, and then switch if one is earlier. I just have no idea how I can compare the dates given the format that they're in.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1003285]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (5)
As of 2018-05-26 10:36 GMT
Find Nodes?
    Voting Booth?