Forum > General
Decompressing a gz file
justnewbie:
Hi guys,
I have a *.gz file (a compressed *.csv) and I need to decompress it.
May I ask a code example?
My attempt using Abbrevia library is shown below (this gives an error: ... exception class 'EAbPartSizedInflate').
I don't insist on Abbrevia if there is any other better/simple solution.
Thank you!
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---procedure TForm1.btnUnzipClick(Sender: TObject);var UnZipper: TAbUnZipper;begin UnZipper := TAbUnZipper.Create(nil); UnZipper.BaseDirectory := '/path/to/folder'; try UnZipper.FileName := 'gzfile.gz'; UnZipper.ExtractFiles('*.csv'); finally UnZipper.Free; end;end;
Handoko:
Have you tried this?
https://wiki.freepascal.org/paszlib
justnewbie:
--- Quote from: Handoko on July 02, 2022, 07:32:23 pm ---Have you tried this?
https://wiki.freepascal.org/paszlib
--- End quote ---
Thanks for the answer! Does it support 'gz'?
justnewbie:
--- Quote from: Handoko on July 02, 2022, 07:32:23 pm ---Have you tried this?
https://wiki.freepascal.org/paszlib
--- End quote ---
I got "corrupt zip file" error (not corrupted!), so I think it doesn't support 'gz'.
Handoko:
Near the bottom in link I gave you, it said:
--- Quote ---Article demonstrating handling tar, bzip2, gzip, zip files ...
--- End quote ---
I haven't tried, but maybe you can find your answer in that article.
Navigation
[0] Message Index
[#] Next page