File Count

File Count tasks check if a target folder contains a specified number of files. They can be used as Condition task or as Input task.

When used as Input task, the task triggers the process to run only when the condition is true. As long as the condition is false, it does nothing (except log any errors).

Setting the file count to 0 allows to take action, for example, when a scheduled process is expected to have files but it doesn't.

Processing

At run time, the number of files in the folder is compared to the specified value, using the specified operator.

If the folder or file count value is invalid and the task is used as Input task, the process does not run. If it is a Condition task, it returns False. No error is generated.

Output

Job Information definitions

When used as Input task, the File Count task sets the following Job Info variables.

  • %1 - FolderName. The target folder.
  • %2 - Mask. The specified mask.
  • %3 - FileCount: The specified file count.

Task properties

General Tab
  • Target folder: Enter the full path of the folder from which the input files are to be taken, or use the Browse button to select it. Note that subfolders are not processed.
    This is a variable property field. You can use any combination of text, variables and data selections; see Variable task properties.
  • Masks: Enter a single or multiple file names or use file name masks (see Masks). Multiple filters are separated by a semicolon (e.g. *.csv;.xls*).
    This is a variable property field. (See Variable task properties.)
    • Treat as regular expressions: When ticked, the contents of the Mask field are deemed to be a regular expression . You can specify multiple masks based on regular expressions, separating the regular expressions by a semicolon.
      Please refer to Regular Expressions for more information.
    No Variable Data can be used inside this field if the Treat as regular expressions option is ticked. The percent sign, the curly brackets and the period are all key elements of the RegEx syntax, therefore they cannot be mixed and matched with Workflow variable data syntax (e.g. %1, ${global.myvar}, etc.). Also, there is no validation of the RegEx being specified.
  • File count: Select whether the condition is to check if the file count is equal to, less than, greater than, less than or equal to, or greater than or equal to the specified value.
  • Value: Enter the desired file count. This is a variable property field. (See Variable task properties.)

Advanced properties

To get access to the following properties tabs, right-click the plugin in the process and select Advanced Properties.

"Other" Tab
  • Job Information group
    • Information elements: Indicates what Job Info variables are automatically created by the input task.
    • Add lines before first data page: Using the arrows keys you can add any job information directly at the beginning of your data file.
  • Backup input files: Check this to save a copy of each data file that is captured by your input. These files are saved in the PReS Workflow Tools working folders under the "Backup" folder.
    To navigate quickly to the Workflow working folders, press the keyboard shortcut CTRL+ALT+Shift+F4 from within the Workflow configuration tool.
    The number of days to keep backups of jobs processed by input tasks is set per process; see Process properties.
  • Backup filename: Enter the file name that you wish the input data file backup to be saved under.
  • Delete Existing Metadata: Check to remove any Metadata from memory. This option is disabled on initial input tasks, and is checked by default on secondary input tasks.

On Error Tab

For a description of the options on the On Error tab see Using the On Error tab.

Miscellaneous Tab

The Miscellaneous tab is common to all tasks.

It contains a text area (Task comments) that lets you write comments about the task. These comments are saved when the dialog is closed with the OK button and are displayed in The Task Comments Pane.

Check the option Use as step description to display the text next to the icon of the plugin in the Process area.

The tab also provides an option to highlight the task in The Process area with the default color, set in the Preferences (see Colors), or the color selected or defined under Highlight color on this tab.
To revert the selected highlight color to the default color, open this tab, turn the Highlight option off and close the dialog with the OK button; then turn highlighting back on.
Highlighting can also be turned on and off via the task's contextual menu and with the Highlight button on the View ribbon.