title: How does this code explicitly ignore headers while concatenating?
body: <p>This is a doubt on an existing or closed thread, however I was disabled from adding a comment that's why this. I was checking out this code and wondering how this piece is carefully getting rid of headers from other files while merging ?  I do not see any element in the code that is set to ignore the headers from the files.
  Code that I'm referring to:</p>
  <p><a href="https://stackoverflow.com/questions/44791212/concatenating-multiple-csv-files-into-a-single-csv-with-the-same-header-python">Concatenating multiple csv files into a single csv with the same header - Python</a></p>
  <pre><code>import shutil
  import glob
  
  
  #import csv files from folder
  path = r'data/US/market/merged_data'
  allFiles = glob.glob(path + &quot;/*.csv&quot;)
  allFiles.sort()  # glob lacks reliable ordering, so impose your own if output order matters
  with open('someoutputfile.csv', 'wb') as outfile:
      for i, fname in enumerate(allFiles):
          with open(fname, 'rb') as infile:
              if i != 0:
                  infile.readline()  # Throw away header on all but first file
              # Block copy rest of file from input to output without parsing
              shutil.copyfileobj(infile, outfile)
              print(fname + &quot; has been imported.&quot;)
  </code></pre>