csvs-to-sqlite icon indicating copy to clipboard operation
csvs-to-sqlite copied to clipboard

CSVs with lines ending \r\n result in missing first column and shift in data columns

Open michalskop opened this issue 6 years ago • 0 comments

I the CSV file uses \r\n as it's row ending, the csvs-to-sqlite misses the first column (of data) and shifts the columns "to the left" (and the last column is therefore empty)

The \r\n ending is the default behaviour of Python's csv.writerow, see https://docs.python.org/3/library/csv.html#csv.Dialect.lineterminator

E.g.:

CSV:

id,value,number
1,3,2
2,1,7
3,4,1

results in SQLITE table:

id,value,number
3,2,
1,7,
4,1,

michalskop avatar Dec 19 '19 18:12 michalskop