title: SSIS: Loop on multiple directories given in an Excel
body: <p>I have to read several input files of same structure and different origin with SSIS. These files are stored in multiple directories. Each directory contains multiple files that are related to a specific company location. The files are of same structure.</p>
  
  <ul>
  <li>Factory A --> file A, file B,...</li>
  <li>Factory B --> file C, file D,..</li>
  </ul>
  
  <p>There is also an Excel with some details on Factory A and B. We plan to push the data to SAP and each file needs a specific accounting code depending on its location/factory.
  E.G. 
  Factory A, account 12345
  Factory A, account 54321</p>
  
  <p>The idea was to first read the Excel line by line with the names of the factories and then do a For Each-Loop on each directory to read the files.</p>
  
  <p>I managed to read a single directory by filling a variable with the directory name. E.g. I start with <code>gstrSubdir="Factory A"</code> and then do a simple Foreach-Loop on the subdirectory. So far, I am fine.</p>
  
  <p>Now I need a loop that reads the first line of the Excel, sets the subdir variable, loops on the subdir and then reads the next line.</p>
  
  <p>In principle I need to know how to do a nested For-Loop in SSIS without C#.</p>
  
  <p>I hope my explanation is somehow understandable.</p>
  
  <p>Would be more than happy to get some advice.</p>
  
  <p>Regards,
  Lars</p>