Search, Copy and Move specific files from one folder (has subfolders) to another in SSIS

605 views Asked by At

I have built a SSIS solution to search and copy specific files from a folder and move to a new location with a new Filename. This solution is helpful only if I know the exact folder in which all the files are present.

Please can someone give me suggestions to search a filename in a Folder which contains many subfolders within it? There are more than 1 million files in these folders with different extensions. My only option is to search/pass specific file names. So if the filename is found in any of the folders, the SSIS package has to copy and move it to the new location.

Please see below the steps I have followed in my current SSIS package. This package doesn’t traverse any subfolders as it has the exact filePath specified in it. SSIS package Image is included as well.

ExecuteSQLTask passes FromFilePath and NewFilePath from SQL table.
The recordset is stored in SSIS object variable.
Using Foreach loop container and Foreach loop enumerator I loop through the filepaths and pass it to the Scripttask to see if the FileExists.
If the file exists then I pass it to the rename task else I store the path name in a txt file for reference.

Thanks in advance.

enter image description here

0

There are 0 answers