WILDCARDSEARCH(ROOTDIR, SEARCHSTRING) Searches the file system from the starting directory ROOTDIR for files and folders matching the pattern SEARCHSTRING. The function WILDCARDSEARCH is similar to the search file option in Explorer.
Have a look at the source code for more information. For more info on this function and how to use it, bug reports, feature requests, etc. feel free to contact the author.
Bob Hamans (2021). wildcardsearch (https://www.mathworks.com/matlabcentral/fileexchange/16217-wildcardsearch), MATLAB Central File Exchange. Retrieved .
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Create scripts with code, output, and formatted text in a single executable document.
Well written and very useful.
Small bug was crashing program when it encountered empty folders, which has been fixed.
A version has been written to work over FTP servers (including passive mode), so that you can search for files recursively and upload all files matching specified criteria.
Example 1: Finds all jpg and tif files:
rootdir = 'C:\'
searchstr = '*.jpg;*.tif';
files = wildcardsearch(rootdir, searchstr);
Example 2: Finds all files named EXPxxx.DAT:
rootdir = 'C:\'
searchstr = 'EXP???.DAT';
files = wildcardsearch(rootdir, searchstr);