Reputation: 872
I have a gz
file that I wanna parse. I am using Zlib::GzipReader
library to open it.
In console I have the file like this:
164] pry(main)> file
=> #<Zlib::GzipReader:0x00007fadbbfa5a08>
[166] pry(main)> Zlib::GzipReader.open(file.path){|gz| print gz.read }
"Date","Connection type code","Connection id","Currency","Impressions","Campaign","Traffic source","Clicks","Cost (EUR)","Country"
=> nil
Notice that, after reading the file and printing. I just got the first line but in fact, the file contains lots of lines and I wanna have them all
Upvotes: 1
Views: 1071
Reputation: 31
Your issue is related to this bug:
Zlib::GzipReader only decompressed the first of concatenated files.
Since it is still unsolved, you can use multiple_files_gzip_reader gem to bypass Zlib's limitation.
Upvotes: 3