none
SSIS : Move file from one folder to other RRS feed

  • Question

  • Hi Guys - 

    In a folder A i have 100's of pdf files. Below is the format:

    CompanyName_CompanyID_CustomerID_Getdatetimestamp. 

    Sample file names : IronWorks_137_86678_20191008070511

    Firebrand_7_86678_20191008070511

    Woodworks_150_86678_20191008070511

    My question is, If the companyID in the file name has value of 1 or 7 or 141 or or 103 or 142, I need to move them to folder B. 

    How can i do this in SSIS ? Thanks

    Tuesday, October 8, 2019 3:35 PM

Answers

  • Hi kkran,

    We could use Foreach Loop Container, Sequence Container(Null), Precedence Constraint,

     File System Task to move specified files one folder A to folder B.

    1.Extract all the filenames of the .pdf files in folder A.

    2.Add expression in precedence constraint.

    • Expression:
    TOKEN( @[User::FileName] , "_",2 )=="1"||TOKEN( @[User::FileName] , "_",2 )=="7"||TOKEN( @[User::FileName] , "_",2 )=="141"||TOKEN( @[User::FileName] , "_",2 )=="142"

    3.Move the specified files from folder A to folder B.

    Best Regards,

    Mona


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com


    Wednesday, October 9, 2019 2:33 AM

All replies