csvkit icon indicating copy to clipboard operation
csvkit copied to clipboard

csvclean: Warn about trailing commas

Open inodb opened this issue 10 years ago • 4 comments

When a csv has multiple empty columns without headers, no errors are shown.

$ echo -e 'h1,h2,,,\na,b,,,' | csvclean -n
No errors.

This is a common error when exporting data from excel so it would be nice if this would be caught in some way. Maybe by confirming there is at least one value in a given column or the column has a header.

inodb avatar Jul 16 '15 14:07 inodb

Is this actually an error though? It wouldn't cause problems for any code that reads CSVs that I can think of.

jpmckinney avatar Jan 25 '16 17:01 jpmckinney

I guess it's not a syntax error, but it is a common mistake when creating csv files manually. Maybe more of a lint error. A warning would be useful though

inodb avatar Jan 26 '16 17:01 inodb

Good idea: We can add a warning.

jpmckinney avatar Jan 26 '16 18:01 jpmckinney

:+1:

gheeshuggah avatar Aug 15 '18 17:08 gheeshuggah