File System - Concatenate Files |
<AMFILESYSTEM ACTIVITY="concatenate_files" SUBFOLDERS="yes/no" EXCLUDE="text" RE="yes/no" ISNEWERTHAN="DateSerial%" FILEA="text" FILEB="text" CONCATENATEDFILE="text" ENCODING="text (options)" OVERWRITEFILE="yes/no" /> |
Description:
Concatenates the contents of two or more files and outputs the result onto a destination file. Specify more than one filename with the use of wildcard characters (e.g., * or ?). To specify multiple files or wildcard masks, separate them with a pipe symbol (e.g., c:\*.txt|c:\*.bak). If entering a list of files, they will be concatenated in the order they are entered. If the destination file does not exist, it will be created.
Generally used to quickly join a group of files (typically text-based files) together into a single file.
General
Property |
Type |
Required |
Default |
Markup |
Description |
File A |
Text |
Yes |
(Empty) |
|
The path and filename of the first file to concatenate. To specify multiple files with identical extensions, use basic wildcard characters (e.g.,*. txt). In this case, files will be concatenated in alphabetical order. To specify multiple files or wildcard masks, separate them with a pipe symbol (e.g.,c:\*.txt|c:\*.bak). In this case, files will be concatenated in the order they are entered. NOTE: Since multiple files are supported, you can indicate all files you wish to concatenate within this parameter using the appropriate wildcards and skip the File B parameter altogether. |
File B (optional) |
Text |
No |
(Empty) |
|
The path and filename of the second file to concatenate. To specify multiple files with identical extensions, use basic wildcard characters (e.g.,*. txt). In this case, files will be concatenated in alphabetical order. To specify multiple files or wildcard masks, separate them with a pipe symbol (e.g.,c:\*.txt|c:\*.bak). In this case, files will be concatenated in the order they are entered. NOTE: Since multiple files are supported, you can indicate all files you wish to concatenate in the File A parameter using the appropriate wildcards and skip this parameter altogether. |
Concatenated file |
Text |
Yes |
(Empty) |
CONCATENATEDFILE="C:\Temp\FileB.txt" |
The path and filename of the output (concatenated) file. If this file does not exist, it will be created at runtime. |
Overwrite if file exists |
Yes/No |
No |
No |
OVERWRITEFILE="YES" |
If set to YES, indicates that, if files with matching names already exists in the destination, they will be overwritten. If set to NO, files with matching names will not be overwritten, however, an error will occur as a result. The default value is NO. |
Encoding for concatenated file |
Text (Options) |
No |
Default |
|
The encoding method set for the output (concatenated) file. The available options are:
NOTE: Most of the time, using the default encoding scheme (Unicode) for the locale of the host operating system is good enough. However, this parameter is useful if you are working with files that originate from another source. |
File Options
Property |
Type |
Required |
Default |
Markup |
Description |
Include subfolders |
Yes/No |
No |
No |
SUBFOLDERS="YES" |
If set to YES, specifies that, if present, subfolders should be searched for files matching the mask specified in the File A and/or File B parameters. This parameter is set to NO by default. |
Exclude mask |
Text |
No |
(Empty) |
|
Causes this activity to omit files matching the mask(s) specified. Filenames or wildcard masks may be used. Multiple entries may be specified by separating them with a pipe symbol (|), for example: *.txt|*.bak |
Regular expression |
Yes/No |
No |
No |
RE="yes" |
If set to YES, indicates that any value entered in the Exclude mask parameter will be interpreted as a regular expression. If set to NO (default) the value will be interpreted as normal readable text. |
Only if newer than |
Date |
No |
(Empty) |
ISNEWERTHAN= "%DateSerial(2001,10,12) + TimeSerial(00,00,00)%" |
If enabled, causes this activity to only act on files that are newer than the date/time specified. If this parameter is left blank or disabled (default), file dates are ignored. Click the Custom button to select from a list of pre-defined date parameters. Enable the Expression option to allow entry of a date/time expression. |
Only if older than |
Date |
No |
(Empty) |
ISOLDERTHAN= "%DateSerial(2001,10,12) + TimeSerial(00,00,00)%" |
If enabled, causes this action to only act on files that are older than the date/time specified. If this parameter is left blank or disabled (default), file dates are ignored. Click the Custom button to select from a list of pre-defined date parameters. Enable the Expression option to allow entry of a date/time expression. |
File Filter
Property |
Type |
Required |
Default |
Markup |
Description |
Attributes |
Text Options |
No |
(Empty) |
ATTRFILTER="+R+A-H" (compress read-only & archive files but not hidden files) |
This group of settings causes the action to filter which files are compressed based on the attribute settings of the source file(s). In visual mode, a group of controls are provided to assist in the selection of this parameter. In markup mode, a single text item must be specified that contains the attributes of the files you wish to compress. Available Options:
|
NOTE: The sample AML code below can be copied and pasted directly into the Steps panel of the Task Builder. |
<AMCONCATENATEFILE FILEA="C:\FolderA\FileName1.DOC" FILEB="C:\FolderB\FileName2.doc" CONCATENATEDFILE="C:\FolderC\NewConcatenatedFile" OVERWRITEFILE="YES" /> |