JuliaLang / julia

The Julia Programming Language
https://julialang.org/
MIT License
45.47k stars 5.46k forks source link

readcsv fails on many csv files #5838

Closed my-little-repository closed 10 years ago

my-little-repository commented 10 years ago

It seems that readcsv does not really try to parse csv files. For example, readcsv should not split fields on escaped commas (e.g. included in double quotes). With a file temp.csv containing the two following lines

first field, second field, third field first field, "this comma, is escaped", third field

I get the following error

julia> readcsv("/home/data/temp.csv") ERROR: BoundsError() in getindex at ascii.jl:11

So, I guess that this is a feature request. Here is the relevant rfc: http://tools.ietf.org/html/rfc4180

xhochy commented 10 years ago

readcsv is very basic, for a more featureintensive variant see http://juliastats.github.io/DataFrames.jl/io.html

kmsquire commented 10 years ago

While it is true that readcsv is basic, it does seems reasonable to me that it handle quotes and escaped commas.

JeffBezanson commented 10 years ago

dup of #5375