File Name Search Function

版本 1.0.0.0 (1.8 KB) 作者: Tristan Ursell
Generate a list of file names that meet a set of text search criteria.
349.0 次下载
更新时间 2012/3/22

查看许可证

Tristan Ursell
File Finder
March 2012

filenames = filefinder('searchpath','searchterm1','seartchterm2',...);

This function will return a list of file names that contain all of the given search terms. All entries to this function should be strings. All search terms are case sensitive!

filenames is a cell array.

Conceptual Example:

Let's presume that within 'searchpath' there are, in total, five files:

1) future.txt
2) predictions.txt
3) future predictions.txt
4) predilections.txt
5) predictions for future.txt

Using the search term '.txt' returns a cell array with all five file names.

Using the search term 'tions' returns a cell array with filenames 2 through 5.

Using the serach term 'future' returns a cell array with filenames 1,3, and 5.

Using the search terms 'future' and 'prediction' returns a cell array with filenames 3 and 5.

Using the search term 'future prediction' returns a cell array with only filename 3. Thus one can combine two independent search terms in an ordered search term.

引用格式

Tristan Ursell (2024). File Name Search Function (https://www.mathworks.com/matlabcentral/fileexchange/35816-file-name-search-function), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R2009b
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Search Path 的更多信息

Community Treasure Hunt

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

Start Hunting!
版本 已发布 发行说明
1.0.0.0