code: def merge(args):
      
      p = OptionParser(merge.__doc__)
      opts, args = p.parse_args(args)
  
      if len(args) < 1:
          sys.exit(not p.print_help())
  
      csvfiles = args
      cf = csvfiles[0]
      fp = open(cf)
      for row in fp:
          if row.startswith("Protein"):
              break
      header = row.rstrip()
      print(header)
  
      seen = set()
      for cf in csvfiles:
          fp = open(cf)
          for row in fp:
              if row[0] == '#':
                  continue
              if row.strip() == "":
                  continue
              if row.strip() == header:
                  continue
  
              atoms = row.rstrip().split("\t")
              id = atoms[0]
              if id in seen:
                  logging.error("ID `{0}` ignored.".format(id))
                  continue
  
              seen.add(id)
              print(row.strip())
docs: %prog merge output/*.csv > ahrd.csv
  
      Merge AHRD results, remove redundant headers, empty lines, etc. If there are
      multiple lines containing the same ID (first column). Then whatever comes
      the first will get retained.