File System - Join Files

Declaration

<AMFILESYSTEM ACTIVITY="join_files" FILE="text" DESTINATION="text" 
OVERWRITEFILE="YES/NO" ALLFILEPIECESMUSTEXIST="YES/NO" 
RECYCLEFILEPIECES="YES/NO" />

Description: Joins together (merges) a file previously split into pieces using the Split file activity. Files can be merged to the original filename or to a path and filename of your choice.

Practical Usage

Commonly used to merge large files that were previously split in order to make the original file easier to distribute or transport, such as via FTP or as e-mail attachments.

General Parameters

Property

Type

Required

Default

Markup

Description

Source File

Text

Yes

(Empty)

FILE="C:\Temp\filename.txt"

Indicates the files to join that were originally split using the Split file activity. Files created as a result of a split will include a period followed by a number appended to the original file name starting with .0 (e.g., fileName.txt.0, fileName.txt.1, fileName.txt.2, etc.). This parameter requires the path and filename of only the first split file with the extension *.0 (e.g., C:\Temp\fileName.txt.0). Advanced Workflows will determine the remainder of the files to join.

NOTE: All previously split files you wish to join must reside in the same folder.

Join to original filename

 

 

 

 

If enabled, the files that were created as a result of a split will be joined to the original filename. When this parameter is enabled, the Join to different filename parameter is ignored. This is a visual mode parameter used only during design time, therefore, contains no markup.

Join to different filename

 

 

 

 

If enabled, the files that were created as a result of a split will be merged to a specific path and filename. When this parameter is enabled, the Join to original filename parameter is ignored. This is a visual mode parameter used only during design time, therefore, contains no markup.

Destination

Text

No

(Empty)

DESTINATION="C:\Temp\mergedfile.txt"

The path and filename that the originally split files will be merged onto. If the file does not exist, it will be created at runtime. This parameter is available only if the Join to different filename parameter is enabled.

Overwrite existing file

Yes/No

No

No

OVERWRITEFILE="YES"

If set to YES, destination files with matching names will be overwritten with the newly created file. If set to NO (default), matching filenames will not be overwritten, however, a runtime error will be thrown as a result.

All file pieces in span must exist

Yes/No

No

No

ALLFILEPIECESMUSTEXIST="YES"

If set to YES, all files that were originally created as a result of a split must exist in the same source folder during the merge, otherwise, an error will occur. If set to NO (default), the merge will proceed despite any missing files.

Send file pieces to recycle bin after join is complete

Yes/No

No

No

RECYCLEFILEPIECES="YES"

If set to YES, the originally split files will be sent to the recycle bin when the merge is completed. If set to NO (default) originally split files will remain in the folder.

Description tab - A custom description can be provided on the Description tab to convey additional information or share special notes about a task step.

Error Causes tab - Specify how this step should behave upon the occurrence of an error. (Refer to Task Builder > Error Causes Tab for details.)

On Error tab - Specify what AWE should do if this step encounters an error as defined on the Error Causes tab. (Refer to Task Builder > On Error Tab for details.)

Example

The sample AML code below can be copied and pasted directly into the Steps panel of the Task Builder.

Description: Join parts of source file "C:\Temp\splitfile.txt.0" into "Different" file. New filename is "C:\Temp\Temp\mergedfile.txt". Overwrite if file already exists. All file pieces in span must exist. Recycle all file pieces after join is complete.

<AMMERGEFILE FILE="C:\Temp\splitfile.txt.0" DESTINATIONTYPE="Different" 
DESTINATION="C:\Temp\Temp\mergedfile.txt" 
OVERWRITEFILE="YES" ALLFILEPIECESMUSTEXIST="YES" 
RECYCLEFILEPIECES="YES" />