how to unzip files using loop?
조회 수: 5 (최근 30일)
이전 댓글 표시
i have 1000 .zip files in single folder. i need to unzip all these and store in new folder using loop statement r any in matlab..help me with this..i don't want to waste time by doing unzipping manually
댓글 수: 0
채택된 답변
Andreas Goser
2013년 7월 31일
You could help others helping yourself by providing information of what you already have tried. Right now I only can say use the commands DIR, FOR and UNZIP and you are done.
댓글 수: 0
추가 답변 (1개)
David Sanchez
2013년 7월 31일
zip_files = dir('*.zip');
for k = 1:numel(zip_files)
unzip(zip_files(k).name,'output_directory_here');
end
댓글 수: 3
rui gao
2019년 7월 15일
Hi David,
I meet a problem when I unzip my '*.zip' files through the way you mentioned.
My original '*.zip' files contain '*.jpg' files, and once I use your code to unzip a list of '*.zip' files, it shows:
Unable to write file "xxx.jpg".
The entry may be password-protected or encrypted.'
Could you please give me some hints? Many thanks.
참고 항목
카테고리
Help Center 및 File Exchange에서 File Operations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!