Collates multiple identically structured CSVs into a single CSV file.
(input_files: List[str], output_file: str)
| 86 | |
| 87 | |
| 88 | def collate_csv(input_files: List[str], output_file: str): |
| 89 | """Collates multiple identically structured CSVs into a single CSV file.""" |
| 90 | with open(output_file, mode="w", newline="") as outfile: |
| 91 | writer = csv.DictWriter(outfile, fieldnames=BENCHMARK_FIELDS) |
| 92 | writer.writeheader() |
| 93 | |
| 94 | for file in input_files: |
| 95 | with open(file, mode="r") as infile: |
| 96 | reader = csv.DictReader(infile) |
| 97 | for row in reader: |
| 98 | writer.writerow(row) |
no outgoing calls
no test coverage detected