is possible to read a URL compressed with gzip (tvs.gz) with CSVProvider in F#?

Viewed 46

is possible to read a URL compressed with gzip (tvs.gz) with CSVProvider in F#? Im trying with this code:

type name = CsvProvider<"https://datasets.imdbws.com/name.basics.tsv.gz", "\t">

But, I'm getting this error:

The type provider 'ProviderImplementation.CsvProvider' reported an error: Cannot read sample CSV from 'https://datasets.imdbws.com/name.basics.tsv.gz': Couldn't parse row 1 according to schema: Expected 2 columns, got 1

So, is possible to use a type provider in F# to do easy analisys over compressed CSVs?

1 Answers

You'll need to decompress the file with something like GZipStream, before being able to read it with CsvProvider.

Related