Move Some Files

Purpose

Moves a batch of files from one folder to another.

Move Some Files Node

Usage

There are times when you have a large number of files, in a folder, to process but you want to process them in batches. Say you have a folder containing 5000 files but you only want to process 50 at a time. Each time the workflow is run, 50 files will be moved to, say, a processing folder.

The ‘Move Some Files’ node takes a wildcard and moves the first n number of files matching that wildcard. Where n is a configurable setting.

Filename

The name of the file(s) that will be moved, e.g. *.csv.

Wildcards

Standard * and ? wildcards are fully supported allowing you to copy all files matching a particular wildcard pattern.

The node can also use more advanced wildcards such as those based around ranges: […]

Wildcard Description Example Matches Does not match
* matches any number of characters myfile.txt myfile.txt or myfile.csv myfile1.txt
? matches a single character myfile?.txt myfile1.txt myfile22.txt
[abc] matches one of the characters provided [pf]ile.txt file.txt, pile.txt mile.txt
[a-z] matches one character from the range provided myfile[0-9].txt myfile1.txt, myfile2.txt myfile10.txt

Additionally use can use the ! character to apply ‘not’ logic

Wildcard Description Example Matches Does not match
[!abc] matches one of the characters NOT provided [pf]ile.txt mile.txt file.txt
[!a-z] matches one character NOT from the range provided myfile[0-9].txt myfilea.txt, myfile22.txt myfile1.txt

From Path

The logical path of the directory containing the file to be moved. You can use the folder browser functionality to set the path if required.

To Path

The logical path to the file from the root of your customer folder on paygate. You can use the folder browser functionality to set the path if required.

Number of Files

This is the integrer amount of files that should be moved each time the workflow is run. The maximum value is 65,535.

Overwrite existing file

If checked the workflow will overright any exuisting files with the same name in the ‘to path’ directory. If unchecked, the workflow is leave intact any existing files in the to folder path with the same name.

Follow error path if no matching files found

If selected, if no matching files are found the node will be deemed to have failed and the error path will be followed. The logging telemetry will show the node completed in an error state.

This behaviour can be used to create different workflow paths if, for example, a file is not found.

In the default (off) state the node will always follow the ‘Success’ path, whether a match file was found (and processed) not not.

Limitations

The node attempts to wait until the move operation has completely finished before going to the next node via the ‘continue’ path. However the file operation is not guaranteed to have finished before the next node is arrived at. If you think this might cause a problem with the remainder of the workflow you can insert a Delay node after the move file node in order to wait a few seconds for the operation to complete.