File Exchange

image thumbnail

findfiles

version 1.0 (2.88 KB) by

This function finds all files with a specified extension in a directory and all subdirectories.

4.16667
5 Ratings

0 Downloads

Updated

No License

This function finds all files with a specified extension in a directory and all subdirectories. The file names are returned as a cell array of the fully specified path to the file.

There is also an option to turn off the recursive search of subdirectories.

This has been tested under MATLAB 6, Release 12

Comments and Ratings (6)

brent f

works great. thank you for posting!!!

Claudia Hofemann

Hi,
I really like the tool, but it would be even better if it would be possible to run it with wildcards.
For example CV7=findfiles('VC7','J:\Carlos000*\')

Or is it possible?
Claudia

Keith McLaurin

The function is case sensitive so you may want to add the lower or upper function if you have mixed case for filenames. Otherwise this is an excellent utility.

for i=1:length(d)
% look for occurences of ['.' extension] in the file name
% modified with lower function to eliminate case sensitivity
extIndices = findstr(lower(['.' extension]),lower(d(i).name));

Thorbjorn Aklint

Very usefull and excellent work!
Thanks.

Sylvain Fiedler

That's what people need ;)

Thank you very much for this one!!

John Madsen

Works fine under windows.

MATLAB Release
MATLAB 6.0 (R12)
Acknowledgements

Inspired: findFiles, GetExtension, Another recursive find file

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video