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

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.