aboutsummaryrefslogtreecommitdiff
path: root/contrib/csv-parser.py
blob: 902932146d001cc9df8d7f7d974e5d49fe905a17 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#! /usr/local/bin/python3.7

import csv, time, sys

with open(sys.argv[1]) as csv_file:
    start = time.time()
    csv_reader = csv.reader(csv_file, delimiter=',')
    line_count = 0
    for row in csv_reader:
        if line_count == 0:
            line_count += 1
        else:
            line_count += 1

    end = time.time()
    print(f'Processed {line_count} lines.')
    print(end - start)