Error using gunzip function
8 views (last 30 days)
Show older comments
Hi,
I have been using gunzip to process large quantities of data as shown below. I have about 100,000 files per year and 14 years to do.
This does exactly what I need - decompresses the .gz file and returns it to the original folder using exactly the same name but in .dat format.
files=gunzip('*.gz');
I have successfully (and very slowly) decompressed the first 7 years worth. However, I now keep getting the following error:
Error using gunzip>gunzipwrite (line 234)
Unexpected end of input stream when attempting to GUNZIP the file "metoffice-c-band-rain-radar_uk_201103071320_1km-composite.dat".
Error in gunzip>gunzipEntries (line 154)
names{k} = gunzipwrite(entries(k).file, outputDir, baseName, streamCopier);
Error in gunzip (line 90)
names = gunzipEntries(entries, outputDir);
Error in open2011 (line 1)
files=gunzip('*.gz');
Is there anything I can do to fix this error? When I restart the code, it decompresses the files that have already been decompressed and stops at the same error eventually.
Also, any suggestions in terms of speeding up the decompression process would be great. Also, it might be worth noting that I am using a mac.
Thanks in advance.
6 Comments
Walter Roberson
on 13 May 2018
I recommend using an external unzip instead of using gunzip(). gunzip() uses java methods and so is limited to java efficiency and has runs the risk of exceeding allocated java memory.
Answers (0)
See Also
Categories
Find more on Data Import and Analysis in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!