SSIS C# zip file or folders according to table with directory
Budget: $15 – $20 USD
I want to zip files / folders in a network drive using SSIS and C# script task. The directory information as well as whether the directory contains file or folder is extracted from a sql table (execute sql task must be used)
eg if directory has files then
\\DESKTOP-AN1Q4RO\Users\pc\Desktop\SampleDir\Apple\ImportFiles\abc_20220105.txt
zip to : \\DESKTOP-AN1Q4RO\Users\pc\Desktop\SampleDir\Apple\ImportFiles\2022 Jan.zip\20220105.txt
if directory has folders then
\\DESKTOP-AN1Q4RO\Users\pc\Desktop\SampleDir\Apple\ImportFiles\20230103\
zip to: \\DESKTOP-AN1Q4RO\Users\pc\Desktop\SampleDir\Apple\ImportFiles\2023 Jan.zip\20230103\
All 2023 Jan files or folders in that directory should be zipped in one file
After zipping delete the files \ folders
I already have scripts to zip files and zip folders separately. So its just a matter of doing an if statement in order to only have one C# script task
eg if directory has files then
\\DESKTOP-AN1Q4RO\Users\pc\Desktop\SampleDir\Apple\ImportFiles\abc_20220105.txt
zip to : \\DESKTOP-AN1Q4RO\Users\pc\Desktop\SampleDir\Apple\ImportFiles\2022 Jan.zip\20220105.txt
if directory has folders then
\\DESKTOP-AN1Q4RO\Users\pc\Desktop\SampleDir\Apple\ImportFiles\20230103\
zip to: \\DESKTOP-AN1Q4RO\Users\pc\Desktop\SampleDir\Apple\ImportFiles\2023 Jan.zip\20230103\
All 2023 Jan files or folders in that directory should be zipped in one file
After zipping delete the files \ folders
I already have scripts to zip files and zip folders separately. So its just a matter of doing an if statement in order to only have one C# script task