Borrar filtros
Borrar filtros

Code get stuck after "gunzip" command

2 visualizaciones (últimos 30 días)
Katy Weihrich
Katy Weihrich el 26 de Feb. de 2018
Respondida: Katy Weihrich el 26 de Feb. de 2018
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)

Respuestas (1)

Katy Weihrich
Katy Weihrich el 26 de Feb. de 2018
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

Categorías

Más información sobre File Compression en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by