A member from this group assisted me in copying files to a follow based on date
I would like to tweak the code to copy file based on certain characters in a filename – in the example that follows the characters are 1111, 1112, 1113 and 1114 So, if we have four files as follows:
File_Account_1111_exam1.csv File_Account_1112_testxx.csv File_Account_1113_pringle.csv File_Account_1114_sam34.csv
I would like File_Account_1114_sam34.csv copied to the folder only if File_Account_1113_pringle.csv has already been copied to the folder. Likewise I would only want File_Account_1113_pringle.csv copied if File_Account_1112_testxx.csv has been already been copied to the folder and so on.
Therefore, if all files have been copied to a folder it would look something like the following:
dbutils.fs.put("/mnt/adls2/demo/files/file_Account_1111_exam1.csv", data, True)
dbutils.fs.put("/mnt/adls2/demo/files/file_Account_1112_testxx.csv", data, True)
dbutils.fs.put("/mnt/adls2/demo/files/file_Account_1113_pringle.csv", data, True)
dbutils.fs.put("/mnt/adls2/demo/files/file_Account_1114_sam34.csv", data, True)