I need to unzip files automatically in my matlab and when I use the unzip function, I can't unzip a file ending in .sp3.zip.
I need a solution, being able to use some external command, anything, however, needs to be fast because I will work with a large volume of data.
Attached is an example of the data I'm trying to unzip and can't.

 Respuesta aceptada

Walter Roberson
Walter Roberson el 16 de Jun. de 2021

1 voto

The file is not zip and is not gzip either.
If you happen to be using Mac or Linux, then rename the file to end with .Z and then use the system uncompress utility
!cp igs18143.sp3.zip igs18143.sp3.Z
!uncompress *.Z

5 comentarios

Clodoaldo de Souza Faria Júnior
Clodoaldo de Souza Faria Júnior el 17 de Jun. de 2021
I don't use linux, I use Windows 10.
And this file, I can unzip it manually, but via code I can't and I really need this to be done automatically to proceed with my code.
Walter Roberson
Walter Roberson el 17 de Jun. de 2021
I suspect that 7zip could handle the files.
Download 7zip
  • install 7z in your machine
  • set the path in Environment Variables -> User Variables path -> edit -> new (add the path - C:\ProgramFiles\7-Zip) -> OK
Once the above is done then inside matlab
filename = 'igs18143.sp3.zip'
cmd = sprintf('7z.exe e "%s"', filename)
[status, msg] = system(cmd)
Clodoaldo de Souza Faria Júnior
Clodoaldo de Souza Faria Júnior el 17 de Jun. de 2021
It finally worked out, thank you very much.
Plus it worked really fast.
Walter Roberson
Walter Roberson el 17 de Jun. de 2021
Which decompress program did you end up using?
Clodoaldo de Souza Faria Júnior
Clodoaldo de Souza Faria Júnior el 17 de Jun. de 2021
I used 7-zip

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Get Started with MATLAB en Centro de ayuda y File Exchange.

Productos

Versión

R2018a

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by