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.

 채택된 답변

Walter Roberson
Walter Roberson 2021년 6월 16일

1 개 추천

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

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.
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)
It finally worked out, thank you very much.
Plus it worked really fast.
Walter Roberson
Walter Roberson 2021년 6월 17일
Which decompress program did you end up using?
I used 7-zip

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기

제품

릴리스

R2018a

태그

Community Treasure Hunt

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

Start Hunting!

Translated by