| 1 | import normalize |
| 2 | |
| 3 | def merge_files(paths): |
| 4 | rows = [] |
| 5 | header = None |
| 6 | for p in paths: |
| 7 | lines = [l.rstrip("\n") for l in open(p)] |
| 8 | if not lines: |
| 9 | continue |
| 10 | if header is None: |
| 11 | header = normalize.header(lines[0]) |
| 12 | rows.extend(normalize.row(l) for l in lines[2:]) |
| 13 | return [header] + rows |
| 14 |