Error uncompressing gz files

10 views (last 30 days)
Cian Vaugh
Cian Vaugh on 30 Apr 2021
Hi.
im trying to extract data thats areanged in "fileName.dat.gz..tar" form, however, the program seems to crash everytime around the 50th tar file with the error
"Error using matlab.io.internal.archive.core.builtin.uncompressgz
File "TempGz\Filename" is not in GZIP format.
Error in gunzip (line 92)
names = matlab.io.internal.archive.core.builtin.uncompressgz({entries.file}, outputDir);
Error in dataExtractorNimrod5km (line 25)
files = gunzip(untar(MASTERFILE,'TempGz'),'TempDat');"
im 100% sure all the files are gz and it happes accross differnt file collections
any suggestions
the file handeling section can proide more of the script if needed
for i_file = 1:length(fileTarCollection)
%%
disp('day')
disp(i_file)
currentFile = fileTarCollection(i_file); %%...
MASTERFILE = currentFile.name
%%file handeling __________________________________________________________
if PLOT_OUTPUT == true
scrsz = get(0,'ScreenSize');
fh1 = figure('OuterPosition',[1 scrsz(4)*.05 scrsz(3)*0.5 scrsz(4)* 0.95]);
end
disp('Extracting files')
files = gunzip(untar(MASTERFILE,'TempGz'),'TempDat');
NoFiles = length(files);
if PLOT_OUTPUT == true
disp('files extracted')
end

Answers (0)

Categories

Find more on File Compression in Help Center and File Exchange

Products


Release

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!