Any sort of office suite would be able to do it, but the data types would be very limited. CSV itself is not standardized, and with a well-constructed spreadsheet wouldn't contain information such as a currency symbol that would make more advances data types possible.
Over here commas are used to denote decimals. So MS decided to helpfully use the semicolon as a separator for csv files if your locale is set to german. Rather than wrapping the values in quotes. It's a PITA
yeah, csv type guess is just one of case. i more likely to have a metadata management solution beyond the data lake, maybe Ontotext Refine's goal is what i want, but it's approach from RDF really sucks.
Python's pandas library essentially does this when creating a DataFrame object from a CSV file. Of course, it's not always correct, but may be a starting point for your use case.
i used pandas, type guess isn't nice. especially on some string or time types. also extend pandas types is hard, pandas's design is more like a numerical computation tool.
15 comments
[ 0.25 ms ] story [ 51.6 ms ] threadActually, CSV is formalized in RFC 4180. Adherence to that spec is another story, of course. :-)
https://www.rfc-editor.org/rfc/rfc4180
e.g. the Import Flat File wizard in SQL Server
Delimted File metadata tool in Talend
Basically they look at the first N rows and take a guess. If the guess turns out to be wrong its usually worse than not guessing at all.
If that's not correct or good enough, then a guessing is not a sufficient solution for this problem.
In C# there's source generators.
I am sure there are other options for other languages.
If you happen to be looking for something in java, you can try: https://github.com/deephaven/deephaven-csv
Benchmarks, along with other java alternatives discussed here: https://deephaven.io/blog/2022/02/23/csv-reader/