title: Use part of non static file name to create new directory
body: <p>I'm new to python and trying to figure some stuff out. </p>
  
  <p>I'm already learning to use the <code>shutil.copy</code>, <code>.move</code> functions as well as scanning files with <code>glob</code>. However I have a few questions on a scenario I'm facing:</p>
  
  <p>Find a file that gets deposited to the same directory everyday, but in which half the file name changes everyday,and use it to make a destination folder, or zip it up with <code>zipfile</code>.</p>
  
  <p>Example:</p>
  
  <ul>
  <li>File <code>X110616.Filename_110416.txt</code> comes in today.</li>
  <li>Tomorrow it will be <code>X110616.Filename_110423.txt</code>.</li>
  </ul>
  
  <p>Since half or part of the name changes everyday, how do I cut/save a specific part of the string for a function or module to create a destination folder, or a zip file?</p>
  
  <p>I can use the <code>glob</code> module to scan for a file with wild card variables, and I've tried using the <code>rstrip()</code>, but that only seems to remove the last half and not the beginning or center of the string.</p>
  
  <p>Also not sure how to save the variables it finds and use it else where to create directories or zip files. Bottom line is I know how to tell the script to look for non-static characters in string but not sure what direction to take it in when using/saving those characters for other things:</p>
  
  <pre><code>import glob
  
      for f in glob.glob("C:\\users\%username%\\Documents\\Test_Files\\X??????.Filename_??????.txt"):
          Newdir = f
          print(Newdir)
          #or use to make a directory, or zip file...
  </code></pre>
  
  <p>This will find me the file with any ending, however I can't seem to understand how to save the file's name or path (whatever it may be).   </p>