checking folder has more than one file with similar name
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
Hi,
I want to check if a folder has files starting with same name.
Eg in a folder, there are files ('test01.mat' , 'test02.mat', 'test03.mat' etc). they start with "test".
how can I check that? thanks.
0 Commenti
Risposta accettata
Voss
il 9 Set 2022
Modificato: Voss
il 9 Set 2022
% use the name of the folder you want to check:
folder = './';
% get info about the files in that folder whose name starts with 'test' and
% whose extension is .mat:
files = dir(fullfile(folder,'test*.mat'));
% see the files' names:
{files.name}
% and/or, see if there is more than one such file:
numel(files) > 1
% etc.
0 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Software Development Tools 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!