title: Get Filename of Timestamped CSV using C# Script in SSIS
body: <p>I am working on an SSIS package that loads data from a CSV file into a staging table in SQL Server. The CSV file will be in the following format:</p>
  
  <pre><code>FILENAME_YYYYMMDD_HHMMSS.csv
  </code></pre>
  
  <p>The YYMMDD portion will always correspond to yesterday's date, but the HHMMSS piece will vary depending on exactly when the CSV file was created.</p>
  
  <p>Is there a way to use a script component in SSIS to do the following:</p>
  
  <ol>
  <li>Check to see if there was a file written yesterday (YYYYMMDD = yesterday's date)</li>
  <li>If so, store the full filename to a variable</li>
  </ol>