question

tush89 avatar image
tush89 asked

SSIS Package for creation of Excel file with files and Folder names in any drive and folder

I just want to create SSIS Package for creation of Excel file with files and folder/sub-folder names in any drive and folder. I mean to say if there is a folder say C:\Temp in my computer then I want to make a list of all folders in excel file. Then I want to rename the file 'Inventory.zip' that is present in the location say C:\Temp\SSISTest\Inventory.zip If 'Inventory.zip' is present at multiple locations in different folders i.e more thatn one folder like C:\Temp\OrdinaryPackage\Inventory.zip then I also want to rename that file 'Inventory.zip' irrespective of it's location in any sub-folder. Can anybody help me with this as early as possible? Thanks in Advance!!!
ssisexceldatabase-files
2 comments
10 |1200

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

Venkataraman avatar image Venkataraman commented ·
Can you please tell clearly, whether you will pass any folder name as parameter to this package ? and the package has to get the list of folders/subfolders of that parameter ?
0 Likes 0 ·
tush89 avatar image tush89 commented ·
Yes. I want to pass the Folder name as input parameter and it will have to perform the task for all folders and subfolders within that parameter.
0 Likes 0 ·

1 Answer

·
Venkataraman avatar image
Venkataraman answered
You can have a Data Flow task and inside that you can have Script Component as source and implement logic to get the list of folders and subfolders (Refer http://stackoverflow.com/questions/8609252/how-do-i-list-all-possible-directories-and-paths-to-subfolders-ignoring-files) and load the result into target excel destination. You can have expressions in target excel destination to store the excel file in corresponding path.
10 |1200

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.