how skip some specific files in multiple subfolders in matlab?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Neda
am 27 Apr. 2019
Kommentiert: Neda
am 28 Apr. 2019
I need to skip some specific files in different sub-folders. for example if the filename not contains string charchters such as raw, info, do some operations.
dirName = 'D:\Neda\Pytorch\CAMUS\training\';
fileList = SureScan_getAllFiles(dirName);
for k = 1:length(fileList)-50
filename = fileList{k};
%if filename not contain 'raw') | 'Info_' | 'sequence.mhd' | '_sequence'
% do some operation
end
end
0 Kommentare
Akzeptierte Antwort
Walter Roberson
am 27 Apr. 2019
if ~contains(filename, {'raw', 'Info_', 'sequence.mhd', '_sequence'})
% do some operation
end
contains() requries R2016b or later.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Search Path 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!