Another team is leaving any of these 3 files in our SFTP: a) DTI_AAA.csv.gz, b) DTI_BBB.csv.gz, c) DTI_CCC.csv.gz.
However, there are other files in there already, so I need to list all files and only load "a", "b" or "c". They will not coexist at the same time in the SFTP, once loaded in it's data inserted/updated in their schema, the file should be deleted.
File Transfer activity docsshow the option "list files", and all files would be stored in "vars.filenames".
The List all files option, available when selecting the File listing action, allows you to store all files present on the server in the event variable vars.filenames wherein the file names are separated by \n characters.
I'm currently getting:
09/10/2024 9:04:46 PM Error in the SSH layer
09/10/2024 9:04:46 PM CRL-290002 Download error in cURL
09/10/2024 9:04:45 PM Error in the SSH layer
And also vars.filenames is undefined. - logInfo("vars.filenames = " + vars.filenames)
How do I access those file names and use regular expressions to match only any of these: a) DTI_AAA.csv.gz, b) DTI_BBB.csv.gz, c) DTI_CCC.csv.gz. ?
Regex could be something like: DTI_.*\\.csv\\.gz