how to access a particular format file from a zip file with or without zipping in matlab?

12 ビュー (過去 30 日間)
sandy
sandy 2013 年 7 月 30 日
回答済み: Collin Pecora 2020 年 6 月 24 日
i have 100 zip files..in each i have many files different extension .but i need to take all the .txt files alone from each zip files and want to store in a separate folder..is it possible in matlab??

回答 (5 件)

Sean de Wolski
Sean de Wolski 2013 年 7 月 30 日
doc unzip
doc dir
doc movefile
Bacially use dir with a *.zip extension to find all of the zip files; loop over them and unzip, then use dir again with a *.txt extension in order locate the text files. Then use movefile to move them to your choice location.

David Sanchez
David Sanchez 2013 年 7 月 30 日
Even when you can select the files to zip , when performing the reverse operation you do not have the choice of extracting selected files from within the zipped file. From Matlab, you can unzip the whole content of the zip file and later, delete those you do not need.

Jan
Jan 2013 年 7 月 30 日
Of course you could save some time, when you only extract the txt files. But even posting the question here will probably take more time than extracting all files, moving the txt files selectively and deleting the unneeded files finally.
  1 件のコメント
Jan
Jan 2013 年 7 月 31 日
You can unzip the files in the Windows Explorer simultaneously already and the moving of the specific files works by a Search in the Explorer also. So trying to do this in Matlab and discussing it in the forum wastes time already.

サインインしてコメントする。


Walter Roberson
Walter Roberson 2013 年 7 月 30 日
You might be able to do this using the Java interface to call the java zip handling routines.

Collin Pecora
Collin Pecora 2020 年 6 月 24 日
Allows for extracting specific files from a zip archive.

カテゴリ

Help Center および File ExchangeFile Operations についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by