Processing a gzipped csv-file by line-by-line
Jesse Phillips via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Wed May 10 16:40:08 PDT 2017
On Wednesday, 10 May 2017 at 22:20:52 UTC, Nordlöw wrote:
> What's fastest way to on-the-fly-decompress and process a
> gzipped csv-fil line by line?
>
> Is it possible to combine
>
> http://dlang.org/phobos/std_zlib.html
>
> with some stream variant of
>
> File(path).byLineFast
>
> ?
You can't really parse a CSV file line-by-line.
H.S. Teoh mentioned fastcsv but requires all the data to be in
memory.
If you can get the zip to decompress into a range of dchar then
std.csv will work with it. It is by far not the fastest, but much
speed is lost since it supports input ranges and doesn't
specialize on any other range type.
More information about the Digitalmars-d-learn
mailing list