in reply to optimize the code

You'd make helping you a lot easier if you would also post

  1. half a dozen lines of the file;
  2. a brief description of the purpose of the program.

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
RIP an inspiration; A true Folk's Guy

Replies are listed 'Best First'.
Re^2: optimize the code
by Anonymous Monk on Jun 24, 2010 at 11:13 UTC
    66.249.65.27 - - [21/Jun/2010:08:00:00 +0000] GET - + - - 66.250.65.27 - - [21/Jun/2010:08:00:00 +0000] GET - + - - 66.244.65.27 - - [21/Jun/2010:08:00:00 +0000] GET - + - -
    In input file,4th column was GMT time. So this was converted to PST time, and if the date matches, 3 day ago date format in the 4th coulmn, only then it was written to the output file