I have a standard gzip file that I would like to read in sequence in F #. I found an example of how to read a regular file in Expert F # 3.0 and the .NET GZipStream Class link in the MSDN documentation, but I'm new to F # /. NET and donβt know how to combine these two to get the desired result.
In particular, how can I change the code below to read a gzipped file, for example test.txt.gz?
let linesOfFile = seq {use reader = new StreamReader(File.OpenRead("test.txt")) while not reader.EndOfStream do yield reader.ReadLine()}
source share