I need to iterate through 180 files and compare if they match based on location; if there's a match compare the date and time. In addition, I need to validate that a .complete file is associated with the file without an extension; otherwise, disregard it and don't store value. Once the latest file for each location is identified, I need to store that value to be read later on in the flow so that i can iterate through each of the files that have been identified as being the latest file for that location.
Below is the breakdown of the files.
TimeRecord(1000129)20211007_220620
Location = (1000129)
Date = 20211007
Time = 220620
******************************************************
TimeRecord(1000129)20211007_220620
TimeRecord(1000129)20211007_220620.complete
TimeRecord(1000129)20211007_221050
TimeRecord(1000129)20211007_221050.complete
TimeRecord(1000130)20211007_220620
TimeRecord(1000130)20211007_220620.complete
TimeRecord(1000130)20211007_221050
TimeRecord(1000130)20211007_221050.complete