Edit log file
Posted: Tue Jun 17, 2003 2:00 pm
I have a rather large lof file (350 MB) which cannot be edited from my desktop.
Would it be possible to use PHP to open this file and delete certain line ?
I would like to delete all of last years entries/lines while keeping this year's ?
The file looks like this:
66.196.65.21 - - [30/Dec/2003:23:56:11 -0500] "GET /robots.txt HTTP/
66.196.72.53 - - [31/Dec/2003:00:05:04 -0500] "GET /br/cgi/
12.148.209.198 - - [01/Jan/2003:01:04:17 -0500] "GET /robots.txt HTTP/1.1" 404
12.148.209.198 - - [02/Jan/2003:01:08:17 -0500] "GET / HT
How would I go about reading the date within each line and delete lines with old/last year's date ?
Really appreciate the help !
PM
Would it be possible to use PHP to open this file and delete certain line ?
I would like to delete all of last years entries/lines while keeping this year's ?
The file looks like this:
66.196.65.21 - - [30/Dec/2003:23:56:11 -0500] "GET /robots.txt HTTP/
66.196.72.53 - - [31/Dec/2003:00:05:04 -0500] "GET /br/cgi/
12.148.209.198 - - [01/Jan/2003:01:04:17 -0500] "GET /robots.txt HTTP/1.1" 404
12.148.209.198 - - [02/Jan/2003:01:08:17 -0500] "GET / HT
How would I go about reading the date within each line and delete lines with old/last year's date ?
Really appreciate the help !
PM