how to fetch files from each sub directory?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
hi ..example.if i have a folder name as 'DATA',inside this subfolder namely 2000 to 2013(year) are ther..in this each folder(01 TO 12,say month),in each month folder,o1 to 31 days folder are ther,inside each days folder many .zip files are ther..i need to fetch all the .zip files inside main folder('DATA'),and extract them to a separate folder.is it possible? any defined function? i couldnt do with below code..help need
for kk=1997:2013
if exist(folder,'dir')
for ll=1:12
if exist(folder,'dir')
for mm=1:31
currfold=[folders(ii) '\*.zip'];
currfiles=dir(currfold);
%now do something with these files
for jj=1:length(currfiles)
unzip([folders(ii) '\' currfiles(jj).name],outputfolder);
end
end
end
end
end
end
0 Kommentare
Antworten (1)
David Sanchez
am 16 Sep. 2013
Use the dir2 function. With it, you can fetch files recursively.
1 Kommentar
Siehe auch
Kategorien
Mehr zu Scope Variables and Generate Names finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!