title: How can I format value between 2nd and 4th underscore in the file name?
body: <p>I have VBA code to capture filenames to a table in an MS Access Database. </p>
  
  <p>The values look like this:</p>
  
  <pre><code>FileName
  ----------------------------------------------------    
  WC1603992365_Michael_Cert_03-19-2019_858680723.csv
  WC1603992365_John_Non-Cert_03-19-2019_858680722.csv
  WC1703611403_Paul_Cert_03-27-2019_858679288.csv
  </code></pre>
  
  <p>Each filename has 4 <code>_</code> underscores and the length of the filename varies.</p>
  
  <p>I want to capture the value between the <strong>2nd</strong> and the <strong>3rd</strong> underscore, e.g.:</p>
  
  <pre><code>Cert
  Non-Cert
  Cert
  </code></pre>
  
  <p>I have another file downloading program, and it has "renaming" feature with a regular expression. And I set up the following:</p>
  
  <pre><code>Source file Name: (.*)\_(.*)\_(.*)\_(.*)\_\-(.*)\.(.*)
  New File Name: \5.\6
  </code></pre>
  
  <p>In this example, I move the 5th section of the file name to the front, and add the file extension. </p>
  
  <p>For example, <code>WC1603992365_Michael_Cert_03-19-2019_858680723.csv</code> would be saved as <code>858680723.csv</code> in the folder.</p>
  
  <p>Is there a way that I can use RegEx to capture 3rd section of the file name, and save the value in a field?</p>
  
  <p>I tried VBA code, and searched SQL examples, but I did not find any.</p>
  
  <p>Because the file name length is not fixed, I cannot use <code>LEFT</code> or <code>RIGHT</code>...</p>
  
  <p>Thank you in advance.</p>