aboutsummaryrefslogtreecommitdiff
path: root/contrib/csv-parser.py
diff options
context:
space:
mode:
authorThomas Schmucker <ts@its1.de>2025-04-13 22:43:46 +0200
committerThomas Schmucker <ts@its1.de>2025-04-13 22:43:46 +0200
commit7d956c533e9fd7d3bbb9a4a8b7f89f0fe54d4bc3 (patch)
treeea1c5bc19dfe6bacad2d377378c460ee5284e74e /contrib/csv-parser.py
parent85fe3b67a67825dfc5e43959f001b2a7159dc23f (diff)
downloadlibcsv-7d956c533e9fd7d3bbb9a4a8b7f89f0fe54d4bc3.tar.gz
libcsv-7d956c533e9fd7d3bbb9a4a8b7f89f0fe54d4bc3.tar.bz2
libcsv-7d956c533e9fd7d3bbb9a4a8b7f89f0fe54d4bc3.zip
first draft
Diffstat (limited to 'contrib/csv-parser.py')
-rwxr-xr-xcontrib/csv-parser.py18
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
3import csv, time, sys
4
5with 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