Code get stuck after "gunzip" command
이전 댓글 표시
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)
답변 (1개)
카테고리
도움말 센터 및 File Exchange에서 Data Import and Export에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!