Loop Files
Synopsis
This operator executes the inner process tasks on every selected file.
Description
With this operator you can select and filter files of a directory and execute the inner process on every selected file. Macros can be used to extract the file name, file path and file type.
In contrast to the core operator this advanced implementation allows the parallel execution of the inner processes. You can activate the Background Processes Panel and change the Concurrency Level or use the operator Set Concurrency Level.
Input
in
This port expects an IOObject which is passed on to the inner process without being altered. It will be reproduced if used. If you want to execute an inner loop, you have to connect the operators of the subprocess with the inner loop input port. In the first iteration it delivers the IOObject of the in input port.
Output
output_collector
This port collects every result of the inner process. It will be reproduced if used.
Parameters
Directory
Select the directory from where to start scanning for files.
This parameter is only available if the file set port is not connected.
Filter type
Specifies how to filter file names. You can either use standard, command shell like glob filtering or a regular expression.
Filter by glob
"Specifies a glob expression which is used as filter for the file and directory names.
Here is a short overview:
-
- : any number of characters
- **: same as '*', but crosses directory boundaries. Useful to match complete paths.
- ? : matches exactly one char
- : contains collections that are separated by ','. The glob filter will try to match the string to any of the strings in the collection.
- []: contains a range of chars or a single char (e.g.[a-z]).
- String(*): *
- String(?): ?
- String(**): **
Filter by regex
"Specifies a regular expression which is used as filter for the file and directory names, e.g. 'a.*b' for all files starting with 'a' and ending with 'b'. Ignored if empty.",
Recursive
Set whether to recursively search every directory. If set to true, the operator will include files inside sub-directories (and sub-sub-directories ...) of the selected directory.
Enable macros
If this parameter is enabled, you can name and extract three macros (for file name, file type and file folder)and use them in your subprocess.
Macro for file name
If filled, a macro with this name will be set to the name of the current entry. To get access on the full path including the containing directory, combine this with the folder macro. Can be left blank.
Macro for file type
Will be set to the file's extension. Can be left blank.
Macro for file folder
If filled, a macro with this name will be set to the containing folder of the current file. To get access on the full path you can combine this with the name macro. Can be left blank.
Reuse results
Set whether to reuse the results of each iteration as the input of the next iteration. If set to true, the output of each iteration is used as input for the next iteration. Enabling this parameter will force the operator to NOT run in a parallel fashion. If set to false, the input of each iteration will be the original input.",
Enable parallel execution
This parameter enables the parallel execution of the inner processes. Please disable the parallel execution if you either run into memory problems or if you need an inner loop. The end result will be propagated to the outside process and can be used in the usual way.