Get File Names
Description
Get File Names scans a specified directory path and returns a list of files along with their metadata — including filename, path, size, type, extension, modification time, and read/write status — as rows in the data stream. Use this step when your workflow needs to discover files dynamically before processing them, such as iterating over all CSV files in a folder or filtering files by name pattern. It supports regular expression wildcards for file selection and can accept the source path from a previous step field for flexible, data-driven file discovery.
Configurations
| Field Name | Description |
|---|---|
| Filename is defined in field | Enable checkbox if filename is defined in a field.If this is checked the following four fields are activated. |
| Get filename from field | Specify the field from which to retrieve the filename |
| Get wildcard from field | A File can be selected using regular expressions. This field specifies a wildcard for the regular expression. Wildcard you would have a RegEx with something like .*\.dat$ If incorrect regex is specified then ‘Regex pattern is incorrect so no files will be retrieved’ message is displayed. |
| Exclude wildcard field | Specify a wildcard to exclude for the regular expression. |
| Include subfolders | Include files from the folder and sub-folders. |
| File or Directory | Specify the file or directory selection. |
| Regular Expression | Provide a regular expression to search files. |
| Exclude Regular Expression | Provide a regular expression to exclude files. |
| Selected files | This is a tabular list of files selected. |
| Show filenames button | Click this button to see what the filename looks like after selecting all the previous settings. |
| Get | Filter the retrieved file names based on by choosing an option from the list: - All files and folders - Files only - Folders only |
| Include a row number in the output | Enable checkbox to include a row number in the output. |
| Rownum fieldname | Specify a fieldname for holding rownum. |
| Do not report error on no files or folders | Enable this checkbox not throw error on no files or folders. |
| Limit the number of rows returned | Specify a value to limit the number of rows returned to this value. |
| Add the filename(s) to the result list | Enable checkbox to add the filename(s) to the result list. |
Note: The output fields for this step are:
- filename - the complete filename, including the path (/tmp/somefile.txt).
- short_filename - only the filename, without the path (somefile.txt).
- path - only the path (e.g. /tmp/)
- type
- exists
- ishidden
- isreadable
- iswriteable
- lastmodifiedtime
- size
- extension
- uri
- rooturi
- If you have no files then the step(and the workflow) do not abort. If you want to abort the workflow you could use a ‘Detect Empty Stream’ step with some logic.
Secondly, you could also check for no files and abort within a process by the 0 Checks If Files Exist process entry.