title: Read multiple TSV files and write to one TSV file Python
body: <p>So, I have multiple TSV files with the following format:</p>
  
  <pre><code>a    b    c    d    e    f    g    h
  a_1  b_1  c_1  d_1  e_1  f_1  g_1  h_1
  a_2  b_2  c_2  d_2  e_2  f_2  g_2  h_2
  .    .    .    .    .    .    .    .
  .    .    .    .    .    .    .    .
  .    .    .    .    .    .    .    .
  a_n  b_n  c_n  d_n  e_n  f_n  g_n  h_n
  </code></pre>
  
  <p>(First line (a, b, ...) is titles)</p>
  
  <p>I want to read them all and if, for each line, the one of the columns has the attribute I want (let's say it's equal to 1), I want to save that line in a different TSV file with the same format as the one above but the data would be filtered.</p>
  
  <p>I have the code to extract the line I want and write it to a TSV file but I am not sure how to read multiple TSV files and write to a single TSV file.</p>
  
  <p>Here's what I have so far:</p>
  
  <pre><code>with open("./someDirectory/file.tsv") as in_file, 
  open("newFile.tsv","w") as out_file:
  first_line = True
  for line in in_file:
      if first_line: #to print the titles
          print(line, file=out_file)
          first_line = False
      columns = line.split("\t")
      columnToLookAt = columns[7]
      if columnToLookAt == "1":
          print(line, file=out_file)
  </code></pre>
  
  <p>So say that someDirectory has like 80 tsv files. What's the best way to go about iterating through all those and writing the needed lines to out_file?</p>