I have a XML file that I’d like to update from data records in a text file.
This is a small sample of the text file(MSR.txt) record layout. There would be approx. 14 records when the file would be completed and some nights there might be less than 14 records depending on the day of the month:
What I mean by completed is that these records are the completion times for certain nightly batch cycles.
As cycles complete, the last program and its completion time are entered as a record entry to this file.
So, basically this file is growing throughout the night and would be cleared out in the morning.
What I need to do is to read this text file every 15 minutes and update the XML file with entries that are present in the text file.
Not all entries from the text file correspond by exact name in the XML file.
I plan on using a scheduling system to run this Perl script every 15 minutes to see if there’s any new entries in the text file that need to be updated to the XML file.
Record names don’t match with corresponding XML element names. As you can see only a couple of them match each other, but most of them don’t.
Also two of the entries(CM10009 & FM18024) can have different suffixes in the text file.
Text File XML File
<?xml version='1.0' standalone='yes'?>
<TODAY>Wednesday, February 23, 2011</TODAY>