diff options
Diffstat (limited to 'contrib/csv-parser.py')
| -rwxr-xr-x | contrib/csv-parser.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/contrib/csv-parser.py b/contrib/csv-parser.py new file mode 100755 index 0000000..9029321 --- /dev/null +++ b/contrib/csv-parser.py | |||
| @@ -0,0 +1,18 @@ | |||
| 1 | #! /usr/local/bin/python3.7 | ||
| 2 | |||
| 3 | import csv, time, sys | ||
| 4 | |||
| 5 | with open(sys.argv[1]) as csv_file: | ||
| 6 | start = time.time() | ||
| 7 | csv_reader = csv.reader(csv_file, delimiter=',') | ||
| 8 | line_count = 0 | ||
| 9 | for row in csv_reader: | ||
| 10 | if line_count == 0: | ||
| 11 | line_count += 1 | ||
| 12 | else: | ||
| 13 | line_count += 1 | ||
| 14 | |||
| 15 | end = time.time() | ||
| 16 | print(f'Processed {line_count} lines.') | ||
| 17 | print(end - start) | ||
| 18 | |||
