[Files] Contains
Q100117: [Files] Contains
Searches file contents for a specified string or pattern, and returns a list of files where there is at least one matching occurance.
Parameter | In/Out | Description | Other Info |
---|---|---|---|
Source folder | In | A folder to search for eligible or matching files. | |
Filename pattern | In | The base filename pattern to look for eligible files, which accepts OS based wildcards for filenames such as the ? and * characters. Can also use the vertical bar character \| to specify multiple patterns.Examples: *.png Finds only PNG image files. *.jpg\|*.jpeg Finds only JPG and JPEG image files. |
|
Include subfolders? | In | Option to look within subfolders for eligible files. | Default: False |
Content Value | In | String/RegEx to search for in files. | |
Is RegEx? | In | Option to do a regular expression match. | Default: False |
Is Case Sensitive? | In | Whether or not the search will be case sensitive. | Default: False |
Matched file list | Out | List of file paths that matched. | |
Files found | Out | The number of files found by the module. |
(Italics = required parameters)
Notes
The [Files] Contains
module is similar to the [Files] Find
module in that it is built for getting a list of available files from a specified location that meets the search criteria. Where [Files] Contains
differs is that it is built to look for files in the specified location based on the actual contents of the file. Primarily this is built to search for string of human readable text within the potential target files. It doesn't matter if the target files are only human readable text or not, as long as the value being searched for is plain human readable text.
Since the module does provide an option for specifying a regular expression
, you could search on binary files by specifying individual characters codes as if they were part of the expression being searched on.