title: ValueError with file concatanation in Python
body: <p>new to Python so bare with. I have a folder with 20,000 csvs in the ones that are important to me start with <code>'IC'</code> and end in <code>prev_date + '.csv'</code>. I am trying to find a way to concatanate all of these into one file if, when the above start and end filters are applied, it concatenates.</p>
  
  <pre><code>import os
  
  prev_date = str('20190624')
  csv_header = 'Index no,date,thesis,quantity'
  csv_out = 'R:/Sam/simulator/consolidated_positions.csv'
  
  csv_dir = 'R:/Sam/simulator/'
  
  dir_tree = csv_dir
  for dirpath, dirnames, filenames in dir_tree:
      pass
  
  csv_list = []
  for file in filenames:
      if file.endswith(prev_date + '.csv') and file.startswith('IC'):
          csv_list.append(file)
  
  csv_merge = open(csv_out, 'w')
  csv_merge.write(csv_header)
  csv_merge.write('\n')
  
  for file in csv_list:
      csv_in = open(file)
      for line in csv_in:
          if line.startswith(csv_header):
              continue
          csv_merge.write(line)
      csv_in.close()
      csv_merge.close()
  print('Verify consolidated CSV file : ' + csv_out)
  </code></pre>
  
  <p>The issue being i keep getting the project folder back in the traceback</p>
  
  <pre><code>Traceback (most recent call last):
    File "R:/Sam/Project/Branch/concatanator.py", line 10, in &lt;module&gt;
      for dirpath, dirnames, filenames in dir_tree:
  ValueError: not enough values to unpack (expected 3, got 1)
  </code></pre>
  
  <p>I think it has something to do with it expected relative filepaths, not the actual I  provided. </p>
  
  <p>Also, if possible, if anyone there a quick hint on how to exclude the files if they have the word <code>EXTRA</code> anywhere within the file name?</p>