Read CSV files quickly
Beliavsky opened this issue · 4 comments
Since R is used for analyzing large data sets, there are several libraries for reading CSV files quickly, one of them being csvread, written in C++. It would be nice to have a fast CSV file reader in Fortran, even if it's just an interface to one in C or C++.
I have never loaded large data, so I am not sure how fast it is for your use case, but as a package for reading CSV files in Fortran, there is csv-fortran. This package is also introduced on fortran-lang.org.
This could be developed using to_num_from_stream. The fastest apporach I have found to load large numeric ASCII files into memory is to load it fully into a single large string and then stream throught the string pointer.
Can you say more about what you would expect from such a feature beyond what a list directed read can do? Would it be faster than the list directed read? Did you expect to avoid declaring the variables in the Fortran source? That would be super convenient, but probably out-of-scope for a compiled language like Fortran.