CSVFiles.jl icon indicating copy to clipboard operation
CSVFiles.jl copied to clipboard

Automatic loading of tab- and ;- delimited files

Open mkborregaard opened this issue 8 years ago • 3 comments

DataFrames support loading tab-delimited files and semicolon-delimited files automatically by file extension (e.g. .tsv). Is something like that possible? The issues is that comma-delimited files, though apparently the default format in Julia, are more or less restricted to countries with decimal points, i.e. the English-speaking countries: skaermbillede 2017-09-12 kl 07 58 39 In countries where the comma is the decimal separator, semicolon-delimited values are saved automatically in programs like Excel when specifying the csv format. I can't believe the guys who came up with that thought that might be a good idea, but there you are.

mkborregaard avatar Sep 12 '17 06:09 mkborregaard

I feel your pain, my solution to it was to just move to the US a couple of years ago ;)

We can definitely register more file extensions and associate a default separator for each. Besides the .tsv extension, what else would make sense?

davidanthoff avatar Sep 18 '17 19:09 davidanthoff

That's a remarkably radical solution, but desperate situations require desperate measures of course :-) DataFrames support tsv for tab-separated and wsv for space-separated. In the old days prn was often used for space-separated but it's been a while since I last saw a prn file. There seems to be a convention to use csv2 to indicate csv files in the European style, but I've never seen it used as a file extension TBH.

mkborregaard avatar Sep 18 '17 19:09 mkborregaard

https://github.com/davidanthoff/CSVFiles.jl/pull/11

davidanthoff avatar Sep 18 '17 22:09 davidanthoff