File proccessing

  • Hi, I am running some files from subfolders using ssis and I can not go through it (idea I have MainFolder on C:\Import_Files and under the main folder I have subFolders i.e. Folder A,B,C etc and all have files and the idea is to loop through the main folder and get subfolder name and use the variable to go through subFolder A execute the files of folder A and finished and get name for subfolder B and goes on)

    What I have done so far is I used two execute sql task to get file name and take that as a form of variable and pass it through a for each loop container and using ADO enumerator to get the variable,How to pass this variable and assign it to another one that is gonna get a subfolder and process the files.

    Can any one helps

  • There is a much simpler way: use the FOREACH container to loop round all files in a folder and (if required) its sub-folders.

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

  • Hi Phil,

    Can u elaborate on that solution (because if files are on the same folder I do use for each loop together with variable to loop through and run correctly, the problem is when I have subfolders i.e. go to the main folder and go to the subfolder and get files in the sub folder now, I have variable to pass through from the first for each loop but i don't know how to pass it to the second foreach loop and got this error (Error: 0x1 at Foreach Loop Container 1: The variable name "C:\Docs\A" could not be found in the list of variables.)

    Idea is I have Folder Docs on C drive and inside folder Docs I have the subfolders A,B,C etc and inside folder A I have .csv files

    Please help

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply