File System - Join file

Declaration

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

Related Topics    

Description

Joins together (merges) a file previously split into pieces using the File System - Split file activity. Files can be merged to the original file name or to a path and file name 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 by way of FTP or as email attachments.

Parameters

General

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 File System - Split file activity. Files created as a result of a split include a period followed by a number appended to the original file name starting with .0 (for example, fileName.txt.0, fileName.txt.1, fileName.txt.2, etc.). This parameter requires the path and file name of only the first split file with the extension *.0 (for example, c:\temp\filename.txt.0). Automate determines 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 file name. 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 file name. 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 (unlabeled) Text No (Empty) DESTINATION="C:\Temp\mergedfile.txt"

The path and file name 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 selected, destination files with matching names will be overwritten with the newly created file. If disabled (default), matching file names 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 selected, 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 disabled (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 selected, the originally split files will be sent to the recycle bin when the merge is completed. If disabled (default) originally split files will remain in the folder.

Description

Error Causes

On Error

Example

NOTE:
  • The sample AML code below can be copied and pasted directly into the Steps Panel of the Task Builder.
  • Parameters containing user credentials, files, file paths, and/or other information specific to the task must be customized before the sample code can run successfully.

Description

This sample task joins several files into a new, single file.

Copy
<AMFILESYSTEM ACTIVITY="join_files" FILE="C:\Temp\splitfile.txt.0" DESTINATION="C:\Temp\Temp\mergedfile.txt" OVERWRITEFILE="YES" ALLFILEPIECESMUSTEXIST="YES" RECYCLEFILEPIECES="YES" />