Hello again. I’m testing reading a large CSV using CSVFiles instead of CSV.jl because the CSV file is too large for CSV.jl on Windows. But I can not use the CSVFile as a iterable. I’m trying:
function mylength(iter)
n=0
for i in iter
n+=1
end
return n
end
function test(src:: String)
table = load(File(format"CSV", src);
colnames=[:day, :glnprovider, :glnretailerlocation, :gtin, :inventory, :cost, :sales, :price],
colparsers=[Date, UInt64, UInt64, UInt64, Float32, Float32, Float32, Float32],
header_exists=false
)
return table |> mylength
end
test("D:\\Data\\03012019_03312019_17440.csv.gz")
I’m hoping to use the table as iterable to calculate diferent things in streaming. But, i’m getting the error:
MethodError: no method matching iterate(::CSVFiles.CSVFile)
So, i’m found the document developer guide from iterable tables. In that document, the author says that we can call the method getiterator. But when i tried that, the error is:
UndefVarError: getiterator not defined
So, how can i use a iterable table (the CSV file) as a iterator? getting the iterator somehow?