Code covered by the BSD License  

Highlights from
SEARCHFILE

4.5

4.5 | 2 ratings Rate this file 9 Downloads (last 30 days) File Size: 2.18 KB File ID: #24567

SEARCHFILE

by

 

27 Jun 2009 (Updated )

Search for files and directories under a given folder with recursive and filter options

| Watch this File

File Information
Description

Here is the help comments for the file which will provide an overview.

% SEARCHFILE search for files and/or directories under a given folder
% Syntax
% list = searchfile('dir', 'filter', 'recflag')
%
% 'dir'(Optional) -
% The source directory where to search. If not specified,
% current working directory will be used
%
% 'filter'(Optional) -
% File filter('*.txt', 'ABC*.*' etc)
%
% 'recflag'(Optional) -
% 1 = Recurse into subdirectory, otherwise look only in
% the specified/current directory
%
% Eg: list = searchfile('C:\Temp', '*.txt', 1);
% list = searchfile('*.txt', 1);
% list = searchfile(1);
%
% Return value : Structure with following fields
% 'name' - Name of the file/directory
% 'path' - Path to the file/directory
% 'fullpath' - Full path of the file/directory including its
% name
% 'isdir' - Flag indicates whether a directory or file
% 1 = Directory, 0 = File
%
 

MATLAB release MATLAB 7.5 (R2007b)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (3)
12 Oct 2011 Szilárd Németh

Useful file!

13 Aug 2010 Jamie Rodgers

very useful. Tx

08 Jul 2009 Jan Simon

It's worth to mention, that the program calls DOS to perform the search. Therefore this function will not work under Mac and linux.

Updates
08 Jul 2009

Updated to correct an issue regarding argument check

08 Jul 2009

updated for argument check

Contact us