title: SSIS retrieving current folder within a foreach loop traversing subfolders
body: <p>I use SSIS to read .txt files in input and execute my business logic over them saving the output results in a file whose name is the same as the current inpout file (file name dynamically stored in a variable).</p>
  
  <p>When all the files are stored in the same folder, I have no problem accessing them since I use the following expression for the flat file connection string in the data flow: <code>"path" + @[User::inputFileName] + ".txt"</code></p>
  
  <p>Now I have to process a folder with subfolders (I set traverse subfolders in the foreach loop) and I have some issues with the flat file connection string since I cannot use a wildcard like: <code>my path\\subfolder*" + @[User::inputFileName] + ".txt"</code> where every subfolder has same name and changes only the last portion of the name.</p>
  
  <p><strong>How can I save the current subfolder name in a variable so that I can use it in the following way?</strong> <code>"path\\"+ @[User::currentSubFolder] +"\\" + @[User::inputFileName] + ".txt"</code></p>