File Exchange

image thumbnail

wildcardsearch

version 1.0.0.0 (3.32 KB) by Bob Hamans
Searches the file system for files or folders matching a wildcard pattern

3 Downloads

Updated 20 Sep 2007

View License

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.

Cite As

Bob Hamans (2021). wildcardsearch (https://www.mathworks.com/matlabcentral/fileexchange/16217-wildcardsearch), MATLAB Central File Exchange. Retrieved .

Comments and Ratings (4)

Glenn Gomes

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.

Aidan

Matthew

Bob Hamans

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);

MATLAB Release Compatibility
Created with R2007a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!