Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

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})}/

CountZero

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


Comment on Re: How to calculate earliest date from log file
Download Code
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?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1003285]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (11)
As of 2014-10-24 08:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (131 votes), past polls