how to access a particular format files from a drive location?
이전 댓글 표시
hi.. In my D drive,many folders(app. 50 folders) are there.each having many formats of files.i need to access .zip files alone in each of the folders and move to separate folder..i am stuck here..
답변 (2개)
David Sanchez
2013년 8월 28일
The following will return a struct containing the .zip files in the folder specified by path_to_zip_files:
my_zips = dir('path_to_zip_files\*.zip')
Then,
for k=1:numel(my_zips)
my_zips(k).name
end
returns the names of the .zip files recursively. Adapt the code to your needs.
David Sanchez
2013년 8월 28일
편집: Walter Roberson
2013년 9월 4일
0 개 추천
try the function given in the following link for recursive search:
댓글 수: 8
David Sanchez
2013년 8월 28일
the dir2 function provided there present a error, at least in my case. If you comment the " if ispc " condition, the recursive search works with no problem. With that part uncommented, an error message showed up regarding the mex file provided alongside the dir2.m file.
To find all your .zip files:
my_zips = dir2('your_folder','*.zip', '-r');
i think now you have all you needed
sandy
2013년 8월 29일
Cedric
2013년 8월 29일
You have to download DIR2 from the URL given in David's answer, and extract/save it somewhere in your path or in the same folder as the script that you are trying to build/run.
sandy
2013년 8월 29일
Walter Roberson
2013년 8월 29일
Which compiler are you using? What have you selected with
mex -setup
?
sandy
2013년 9월 4일
Walter Roberson
2013년 9월 4일
Please show the complete log of the compilation.
카테고리
도움말 센터 및 File Exchange에서 Write C Functions Callable from MATLAB (MEX Files)에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!