Finding the latest entry.
Posted on 2007-07-24
I have a list of systems in a file called systems.txt
What I need to do is:
1) Read the systems.txt file (done)
2) Connect to each machine (done)
3) Check for the existence of a file (eg. \\\\$systemname\\d\$\\bin\\updatelog.txt)
4) If this file exists, then read the file, and find the following...
14/03/2007 8:44AM Administrator TESTXP Update process successful
16/04/2007 10:26PM Adminstrator TESTXP Replacing file.......
19/06/2007 8:44AM Administrator TESTXP Update process successful
20/04/2007 03:26AM Adminstrator TESTXP Replacing file.......
20/07/2007 8:44AM Administrator TESTXP Update process successful
Out of the above, I need to find the LATEST (by date/time) for the field denoted by "Update process successful". If the latestentry says "Update process successful", then write the $system name, along with the date/time (eg.computer variable for each system in systems.txt) to a file called "success.txt". If it says "Update failed" (and there can be multiple entries as well for this, so only the latest) to a file called "failed.txt".
Any help greatly appreciated.