Info |
---|
|
This routine is available starting with SIL Engineā¢ 1.1.2. |
Syntax
...
Table plus |
---|
applyColStyleToCell | true |
---|
heading | 0 |
---|
columnTypes | s,s,s,s |
---|
multiple | false |
---|
columnAttributes | style="background:#e5e7ea;font-weight:bold,,style="background:#e5e7ea;font-weight:bold, |
---|
enableSorting | false |
---|
|
Syntax | findFiles(directory, regex) | Package | file | Alias | | Pkg Usage | find(directory, regex) | |
Description
Excerpt |
---|
|
Searches for files that match the given regex in the specified folder. |
Searches for files that match the given regex in the specified folder. The routine only searches for files, not directories.
...
Returns a list with absolute paths for files that match the given regex. The regex match is done on the file name, not the full path. If the regex parameter is empty string, the routine returns an empty result.
Parameters
Table plus |
---|
applyColStyleToCell | true |
---|
columnTypes | s,s,s,s |
---|
heading | 0 |
---|
multiple | false |
---|
enableSorting | false |
---|
|
Parameter name | Type | Required | Description |
---|
directory | |
...
String | Yes | Specifies the directory to search into. | regex |
|
...
String | Yes | Specifies the file pattern to search for. |
|
Return
...
Type
string String []Returns an array containing the absolute paths of all files from the given directory which name match the regex.
Example
Code Block |
---|
findFiles("C:/JIRA/plugins", ".*\\.jar");
|
Results: An array containing all absolute paths for jar files from the folder C:\JIRA\plugins.
...
Note |
---|
- It is recommended that you use forward slashes ( / ) for file paths.
- If the regex contains a backslash replace it with two backslashes
|
...
- otherwise you will get a syntax error.
|
See also
Filter by label (Content by label) |
---|
showLabels | false |
---|
max | 25 |
---|
showSpace | false |
---|
cql | label = "file_routines"routine" and space = currentSpace ( ) |
---|
labels | filearray_routines |
---|
|