In the issue tracker of DelimitedFiles
I found a comment
readdlm
is also effectively deprecated and the CSV package should be used
about reading text data files.
I’m trying to read a plain text file listing numbers delimited by newlines and spaces.
Does somebody know where to find a simple tutorial to use the CSV package to do this?
I just blindly tried the CSV package. I got an object containing objects like Vector{CSV.Row}
and I didn’t know how to examine whether my read was successful or not.
The data file includes comment lines indicated by “#”. The file can be read with
using DelimitedFiles
a = readdlm("my-datafile.txt"; comments=true)
a[2,5] # -> the number at row 2, column 5
This is a very simple interface. You just get a 2D array. How does one use the CSV package to do this?
Aside: The data file I’m trying to read turns out including the unicode “zero width no-break space”, which readdlm()
fails to handle. So, I was trying to do something about it, when I found the deprecation comment above.