I have a text based log file that has a list of IP address followed by a time stamp of when the IP address was written to the log file.
What I want to do is clean the log file and remove entries that are over X amount of hours old. If this was a SQL table I would not have a problem but it is a text file. I was thinking of running this from a cron task.
I can control the format of the log file eg how the time stamp is written but I can not port it to a SQL could PHP treat the txt file as a dataset and some how clean it ?
127.0.0.1,2009-01-02 02:00
127.0.0.2,2009-01-02 06:20
127.0.0.3,2009-01-02 05:00
Thank you for your ideas :-)