summaryrefslogtreecommitdiff
path: root/scripts/csv2sto.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/csv2sto.py')
-rwxr-xr-xscripts/csv2sto.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/scripts/csv2sto.py b/scripts/csv2sto.py
index d212494..97d768b 100755
--- a/scripts/csv2sto.py
+++ b/scripts/csv2sto.py
@@ -81,11 +81,15 @@ def main():
tot_nCols = 1 # initial time column (as we omit it when taking data from each CSV)
for f_csv in fs_csv:
fd = open(f_csv, 'r')
+ dialect = csv.Sniffer().sniff(fd.read(1024))
+ fd.seek(0)
+ csv_reader = csv.reader(fd, dialect)
nRows = nCols = 0
- for line in fd:
+ for line in csv_reader:
if nRows == 0:
- nCols = len(line.split(','))
+ nCols = len(line)
+ print("nCols: {}".format(nCols))
nRows += 1
if tot_nRows == 0: