Validate

<< Click to Display Table of Contents >>

Navigation:  Robo-FTP User's Guide > Robo-FTP Framework > Job Definitions > Built In Steps >

Validate

 

Note: First see Working with File Sets for a discussion on how data flows through step to step.

 

The Validate step performs one or more validation routines on files in the current file set and optionally sets macro values that may be used in subsequent steps.

 

Friendly Name

INI Variable

Required?

Description

Minimum Size

min_size

optional

File must not be smaller than this number of bytes

Maximum Size

max_size

optional

File must not be larger than this number of bytes

Minimum Records

min_records

optional

File must not contain fewer than this number of lines

Maximum Records

max_records

optional

File must not contain more than this number of lines

Maximum Change

min_percent

optional

File size must be at no greater than this percent of the size of the last file with the same extension as the file to be validated

CNT File

cnt_file

optional

Use the first space delimited field from the first line of the first file matching the given file mask (e.g. "*.cnt") as a number that indicates how many lines should be found in the file.

Header

header_string

optional

Perl regular expression that must match the beginning of the file

File Filter

specification

optional

Specification for file to match. default is *

Failed File Path

errors_directory

optional

Path of directory to which any files that fail validation will be delivered

N/A

header_lines

optional

number of lines to search at the beginning of the file for the matching value of header_string

N/A

line_endings

optional

override the default CR/LF line terminator sequence; ANY and LF are possible values. When LF is specified, lines are terminated with only the line-feed character. When ANY is specified, lines are terminated with carriage-return only, line-feed only, or a CR/LF pair sequence.

 

 

Setting Macro Values

When the expression defined by the header_string option contains grouping characters () the file characters matching the group are saved as %stepname[#] where the value of %stepname[1] is set to the matching characters for the first group and the value of %stepname[2] is set to the second matched group and so on for as many groups are defined.

 

For example, consider the following option:

 

 header_string=(\w*) \w* (\w*)

 

In perl regular expression parlance \w means word character (alphanumeric,underscore,hyphen) and * means zero or more of the previous character. So, in this example if the step was named "validate" and first line of the file was:

 

 This is the beginning.

 

Then macro values would be set as follows:

 

 %validate[1] = This

 %validate[2] = the

 %validate[3] (This value would not be set.)

 

To continue this example, if the first line of the file was only:

 

 First

 

The validate step would fail as that line cannot match the header_string expression in this example.

 

Example Usage:

step_validate