I'm looking to extract some information from a txt file. The information is not comma seperated but each field (for want of a better phrase) is seperated by spaces. I need to look through each line in the text file looking for a match to a field in an sql database. Once I see a match, then get the date/time from the line in the text file and put it into another field in the database. I then need to do it all over again for a different match (effectively the next name in the sql database) and put that info into the sql database under that name etc etc.
The database is MySQL and has a number of tables in it. The relevant tables are dvrinfo which has a field in called FTPName The FTPName field is what I want to search the attached file for. When I see the match I want to get the date and time for the 230 Logged on line and put the date time in the MySQL dvrinfo table in the field lastlogon.
I need this to happen every 4 hours and then do it again the following day with the next log file. Fun eh?
Is there anyone out there how can point me in the right direction for code, or utils/apps or anything.