Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi, I'm not sure if this board is the right place to put a question like this, but I was wondering if there was a way to automate getting the latest version of a file from my source?
For instance, in the FROM section of a load above, how would I go about automating grabbing the latest version of the FileName file?
The naming convention will always be FileNamm MM.DD.YY.xlsx
How could I set it up to automatically grab the file that will be added to the source on 2.22.2024 without having to change the code weekly to reflect the new file?
Iterate over all of the files matching for example the pattern "FileName *.*.*.xlsx" using a for-loop with FileList(), and then check each file's name for the latest date, or use FileTime(). Store the filename that you need (i.e. the filename of the latest file) into a varable, and use the contents of that variable when loading, e.g FROM [FilePathe/File/$(filenameOfLatestFile)].