dir search multiple files
Mostrar comentarios más antiguos
Hello,
I am using the dir command to search a folder for specific file types. I am looking for both *.jpg and *.png files. How do I structure my statement so that I can search for both file types?
Respuestas (1)
Fangjun Jiang
el 19 de Sept. de 2011
7 votos
Files=[dir('*.jpg');dir('*.png')]
3 comentarios
Walter Roberson
el 19 de Sept. de 2011
I think that might be the only option on MS Windows.
On OS-X or Linux there might be an additional more obscure method,
dir('*.{jpg,png}')
This should NOT be expected to work on MS Windows.
Michael
el 10 de Sept. de 2014
I know this is an old link, but it totally saved me. Thanks!
Steve Grobler
el 9 de Mzo. de 2018
helped me too!!
Categorías
Más información sobre File Operations en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!