List files/folders recursively

"select_files" and "select_files_rec" are used to list files/folders inside a chosen folder


Updated 28 May 2013

View License

selection = select_files(folder,pref,mid,suf,ext,type,path)
selection = select_files_rec(folder,pref,mid,suf,ext,type,fpath,levels)

- FOLDER: parent directory to look the files/folders in
- PREF: files/folders prefix
- MID: middle part of the files/folders
- SUF: files/folders suffix
- EXT: files extension
- TYPE: 'files' or 'folders'
- FPATH: 'path' (SELECTION will have the full path) or 'nopath' (only files/folders names)
- LEVELS: number of levels to go in recursively (0 [files/folders only from FOLDER], 1, 2, ..., Inf)

- SELECTION: cell array containing the file/folder names

Cite As

Guilherme Coco Beltramini (2023). List files/folders recursively (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2010a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Tags Add Tags

Inspired: Count number of lines in a set of files

Community Treasure Hunt

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

Start Hunting!
Version Published Release Notes

Edited the description