I am sorry, I realised that the reason the code did not continue was, that the file was not done unzipping, through you were already able to see the already zipped data when terminating and opening the document
Code get stuck after "gunzip" command
1 次查看(过去 30 天)
显示 更早的评论
I need to extract some ziped data and I wrote a Matlab loop to extract them, however, my code gets stuck every time after a file is unzipped and I need to terminate it.
Since the names of the files (readings.csv.gz-00001-of-00020, readings.csv.gz-00002-of-00020, ...) have this "-00001-of-00020" ending that gets deleted, I also have to rename the unzipped file every time and cannot just unzip the whole folder at ones, since the data would overwrite itself then.
I have:
Components_FileName = '-00001-of-00020'
DATA_Extraction = ['C:\Projects\...\readings.csv.gz' Components_FileName];
FILENAME_OutputPathway = 'C:\Projects\...\extracted\';
UnzipedData = gunzip(DATA_Extraction, FILENAME_OutputPathway)
oldname = UnzipedData;
newname = [FILENAME_OutputPathway 'Unzipeddata_' Components_FileName]
movefile(oldname, newname)
Does someone know what goes wrong? Gunzip seems to be executed well, since I do have the data, in the end, but the code does not continue afterwards.
And when I cancel the command I get this output:
Operation terminated by user during gunzip>gunzipwrite (line 228)
In gunzip>gunzipEntries (line 151) names{k} = gunzipwrite(entries(k).file, outputDir, baseName, streamCopier);
In gunzip (line 87) names = gunzipEntries(entries, outputDir);
In OpenFile (line 87) gunzip(DATA_Extraction, FILENAME_OutputPathway)
0 个评论
回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 File Compression 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!