SSIS - Load the latest file from the folder using the file name

Hi, I need to look for the latest file from a directory and move it to a different directory using the SSIS.

For example, I have the below files in the folder and need to look for the latest test file (Test_20221011.txt) from the directory. I see the solution for finding the newest file from the directory, but I need to look for the latest TEST file. I appreciate your help.

Exam_20221127.txt

Test_20221011.txt

Address_20221009.txt

Exam_20220925.txt

Test_20220620.txt

Test_20220521.txt

Test20220303.txt

Exam_20220201.txt

Thanks,

Mona

You should use a script component to handle this.

Welcome To TechBrothersIT: SSIS -How To Get Most Recent File from Directory And Load To a Table [ SSIS Script Task ]