queryverse / CSVFiles.jl

FileIO.jl integration for CSV files
Other
51 stars 13 forks source link

NO applicable_loaders found for csv #57

Closed xiaodaigh closed 5 years ago

xiaodaigh commented 5 years ago
using CSV
using DataFrames
a = DataFrame(a=[1,2], b=[3,4])
CSV.write("a.csv", a, delim='|', writeheader =false)

using CSVFiles, FileIO, TextParse
@time a = load(File(format"csv", "a.csv"), delim='|')

gettiing error

NO applicable_loaders found for csv

Windows 10 Pro Julia 1.2 TextParse 0.9.1 CSVFiles 0.15.0 FileIO 1.0.7

davidanthoff commented 5 years ago

You need to use capital letters for the format specifier, i.e. format"CSV". Also, delim is not a keyword argument but a positional argument. This should work:

using CSVFiles
@time a = load(File(format"CSV", "a.csv"), '|')

Also note that this won't read the whole file, load is lazy in this scenario. You probably want something like DataFrame(load(...)).