question

sqlhungry avatar image
sqlhungry asked

File System Task SSIS

I have 2 folders, viz, MaskedFolder and OriginalFolder. I have 10 Flatfiles in OriginalFolder out of which only 6 files needs to be hashed and moved from OriginalFolder to Masked. I did that using the Dataflow task and gave the destination of the Flatfile as MaskedFolder. But I also need to move the remaining 4 files from OriginalFolder to MaskedFolder (without any changes) I tried to use the File System Task to do that but it has option to move all the files from one location to another., I dont know how to specify only the specific files to be moved from one location to another. I'm guessing that i can use the expressions in FileSystemTask but dont know which Property to use. Help !
ssistask
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

· Write an Answer
Pavel Pawlowski avatar image
Pavel Pawlowski answered
You can use eg. Foreach Loop Container with File System Task inside it. Then you can configure the Foreak Loop Container in two ways: 1. Configure it as Foreach File Enumerator and specify wildcards to cover your files. Retrieve File Name and Extension. Map it to a variable (string). Then Create two variables with expressions one to build a complete source path and second to build a complete destination path. Then use those two source/destination variables in the File System Task inside the Foreach loop as Source and Destination file Name 2. Configure the Foreach Loop as Foreach Item Enumerator. Configure two columns and put in the enumeration your 4 files. In first column you specify a complete source path and in second column a complete destination path. map those two column to source/destination variables (string). Then Again use those two variables as source and destination path of the File System Task. In both scenarios you specify the IsSourcePathVariable and IsDestinationPathVariable as True. And then select appropriate Source and Destination variables you were assigning source and destination files in the foreach loop.
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.