Can someone please help in the below scenario?
I need to get the files from the SFTP server as per the following conditions:
Execution_202001007 - Folder
-> Contra_07_10_2020.xlsx - File
-> Report_07_10_2020.xlsx - File
Execution_202001006 - Folder
-> Contra_06_10_2020.xlsx - File
-> Report_06_10_2020.xlsx - File
Execution_202001005 - Folder
-> Contra_05_10_2020.xlsx - File
-> Report_05_10_2020.xlsx - File
Execution_202001001 - Folder
-> Contra_01_10_2020.xlsx - File
-> Report_01_10_2020.xlsx - File
Execution_202000930 - Folder
-> Contra_30_09_2020.xlsx - File
-> Report_30_09_2020.xlsx - File
Only the files that starts with Report needs to fetched which are present inside the folder with name as “Execution_YYYYMMDD”
Only last 5 created folders needs to be accessed.
We can not apply weekend logic alone as there might be some exceptions for holidays in weekdays so we just want to access last 5 created folders and get the one file starting with “Report_”
Thank you in advance for the help!