필터 지우기
필터 지우기

Code get stuck after "gunzip" command

조회 수: 2 (최근 30일)
Katy Weihrich
Katy Weihrich 2018년 2월 26일
답변: Katy Weihrich 2018년 2월 26일
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개)

Katy Weihrich
Katy Weihrich 2018년 2월 26일
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

카테고리

Help CenterFile Exchange에서 File Compression에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by