Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Undefined links corrected

Table of Contents
outlinh1. true
outlinh1. true
1printablefalse
2stylh1. none
3indent20px

Description of JobSchedulerCopyFile - Copies one or more files

This job copies one or more files. Examples:

Code Block

 source_file  file_spec  replacing  replacement Example InputOutputComment./temp.*~""hallo.dat~hallo.dat-a.txt-[.]txt_2006-11-24.txt-a_2006-11-24.txt-./temp.*.*[filename:] [date:yyyy-MM-dd].data.txta.txt2006-11-24.dat[filename:] and [date:] will be substituted after file has been replaced./temp.*[.]txta.*?bworlda.1.b.txt.bworld.txt.b.*? : ungreedy usage of .*abcdefg.txt-^(ab)cde(fg)[.]txt123;[date:yyyy-MM-dd]-123cde2006-11-24.txt; : separator between multiple replacements./temp.*dat$(ab)_c[0-9]d_(fg)group1;group2ab_c1d_fg. ab_c2d_fg.datgroup1_c1d_group2. ab_c2d_fg.datOnly the first pattern match is replaced./temp.*^(?:aa|bb)_. \{2\}_([0-9]+_[0-9]+)$tailaa_QU_061205_222334aa_QU_tail(?:...) : "?:" specifies a non capturing group. The file will not be replaced../tempFILE.txt.*[filename:lowercase]_[filename:uppercase]_[filename:]FILE.txtfile.txt_FILE.TXT_FILE.txt-
 source_file  target_file  file_spec  create_dir  replacing  replacement Example inputOutputCommentaaa/bbb/[directory:]/[date:yyyyMMdd]/hello.txttrue[.]txt[date:yyyy].txtaaa/bbb/hello.txtaaa/bbb/20070316/hello2007.txtIf the directory aaa/bbb/20070316 does not yet exist it will be createdFor further information seejava.util.regex.Pattern

...

Parameter: create_dir

If enabled target_file is checked for existence.
If target_file does not exist target_file will be created as a directory.
The default value for this parameter is false.

...

Regular expression for file filtering. Default behaviour is CASE_INSENSITIVE.Only effective if source_file is a directory.
The default value for this parameter is .{*}.

...

String for replacement of the replacing expression.
If multiple groups are to be replaced then one replacement string per group must be specified. These strings are separated by a semicolon ";":
replacement: aa;filename;bbSupports masks for substitution in the file name with format strings that are enclosed by {*} and {*} [and] . The following format strings are supported:

...

  • uppercase Will be substituted by the original file name with all characters converted to upper case.

Requires the replacing parameter to be specified.

...

Regular Expression for filename replacement with replacement .
If the expression matches on the filename the found groups are replaced.
a)
"capturing groups" are used for replacement. Only the content of the capturing groups is replaced.
Replacements are separated by a semicolon ";". Example:

Code Block

 replacing : (1)abc(12)def(.*)
 replacement : A;BB;CCC

...

b)
If no capturing groups are specified the entire match is replaced. Example:

Code Block

 [[Param replacing|replacing]] : Hello
 [[Param replacement|replacement]] : 1234

Input file: Hello_World.txt
Output file: 1234_World.txt
Requires that the replacement parameter is specified.

Parameter: skip_first_files

...

Source file or directorySupports substitution of job parameter names with their value if the job parameter name is enclosed by %  and  % .
Example: <param namh1. name="source_file" value"%scheduler_file_path%" />
During the job runtime the parameter source_file contains the value of the job parameter scheduler_file_path . UsingDirectory Using Directory Monitoring with File Ordersthe Orders the job parameter scheduler_file_path contains automatically the path of the file that triggered the order.
This parameter is mandatory.

...

Target file or directoryIf the target_file is not specified, then the dirctory path of source_file is used as target.Supports masks for substitution in the file name with format strings that are enclosed by {*} and {*} by and  . The following format strings are supported:

  • date format date format must be a valid Java data format string, e.g. yyyyMMddHHmmss , yyyy-MM-dd.HHmmss etc. Example: <param namh1. name="target_file" value"sample/helloyyyyMMdd.txt" /> On 2050-12-31 the parameter target_file contains the value "sample/hello20501231.txt" .
  • directory Is substituted by the directory path of source_file .
  • index Is substituted by the directory path of source_file up to or from the directory number index . index can be a positive number, a negative number or 0.
    Example: source_file is "aaa/bbb/ccc/ddd/" (it contains 4 directories) 2 returns "aaa/bbb" -3 returns "bbb/ccc/ddd" 0 or -0 return always the complete path. 5 or -12 return the complete path in this example.