how to fetch files from each sub directory?
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponses (1)
David Sanchez
le 16 Sep 2013
Use the dir2 function. With it, you can fetch files recursively.
1 commentaire
Voir également
Catégories
En savoir plus sur Scope Variables and Generate Names dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!