How to read folders of diferent names extensions
6 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Dear all, I have folders the name of which is e.g. 000003.537, 000003.637, 000004.037. In each folder is one image file and the name of all image files is the same e.g. 000001.tiff. I am looking for the way how to take out images from all folder and copy them into new folder.
Now I do that in a simple way, that I rename all folder to e.g. 000001, 000002, 000003,... and in such a way I go around the issue with such name 000003.537.
The different name of folder and the changing extension is my problem.
I will appreciate any advice which will lead to more elegant solution. Ludek
0 Commenti
Risposta accettata
Oleg Komarov
il 8 Ago 2012
% retrieve all subfolders's names
s = dir('yourpath');
idx = [s(:).isdir];
names = {s(idx).name}';
% Remove . and ..
names = setdiff(names,{'.','..'});
Now you can loop through each names and movefile() which is inside.
0 Commenti
Più risposte (1)
Vedere anche
Categorie
Scopri di più su Convert Image Type in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!