Exist returning zero when file definitely exists; rehash not working
Mostra commenti meno recenti
I have written a script to help organize my files, the main point of which is to group all graphics of a certain type into one folder (which is made in the execution of the script), and same with other graphics.
Unfortunately I have many folders to do this in, and they are not uniformly filled with the same file types. So I am trying to find out if certain graphics exist, but I get a negative answer if I use a wildcard, where specific file names get a positive:
>> exist([Directory,'01-Oct-2009_1.jpeg'])
ans =
2
>> exist([Directory,'*.jpeg'])
ans =
0
I've tried using rehash and rehash path and neither works. Any idea how I can fix this?
Risposta accettata
Più risposte (1)
Ahmet Cecen
il 25 Lug 2014
0 voti
I am not sure why the wildcar doesn't work. How about using the wildcard with dir beforehand and searching within the matlab matrix?
files = dir('*.jpeg');
This should get you and extensive list of every jpeg in the folder.
Categorie
Scopri di più su File Operations in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!