Skip to main content

Get File Names

Description

GGet File Names is a step in the Input Plugin for Process Studio Workflows. The Get File Names step is used to get information associated with files on a specified path (with filters) in the file system. The associated information includes, 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. The retrieved files along with associated information are added as rows onto the stream.

Configurations

No.Field NameDescription
Filename is defined in fieldEnable checkbox if filename is defined in a field.If this is checked the following four fields are activated.
1Get filename from fieldSpecify the field from which to retrieve the filename
2Get wildcard from fieldA 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.

3Exclude wildcard fieldSpecify a wildcard to exclude for the regular expression.
4Include subfoldersInclude files from the folder and sub-folders.
5File or DirectorySpecify the file or directory selection.
6Regular ExpressionProvide a regular expression to search files.
7Exclude Regular ExpressionProvide a regular expression to exclude files.
8Selected filesThis is a tabular list of files selected.
9Show filenames buttonClick this button to see what the filename looks like after selecting all the previous settings.
Filter Tab:
1Get

Filter the retrieved file names based on by choosing an option from the list:

- All files and folders

- Files only

- Folders only

2Include a row number in the outputEnable checkbox to include a row number in the output.
3Rownum fieldnameSpecify a fieldname for holding rownum.
4Do not report error on no files or foldersEnable this checkbox not throw error on no files or folders.
5Limit the number of rows returnedSpecify a value to limit the number of rows returned to this value.
6Add the filename(s) to the result listEnable 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.