Join File

Declaration

<AMMERGEFILE FILE="text" DESTINATIONTYPE="text" DESTINATION="text" OVERWRITEFILE="Yes/No" ALLFILEPIECESMUSTEXIST="Yes/No" RECYCLEFILEPIECES="Yes/No" />

See Also

Split File | Move File | Create Folder | Delete File | Delete Folder | Rename Folder | Remove Folder | Touch File | Set Attributes | Read from File | Write to File | Synchronize Folders | Concatenate Files

File System - Join File

Declaration

<AMMERGEFILE FILE="text" DESTINATIONTYPE="text" DESTINATION="text" OVERWRITEFILE="Yes/No" ALLFILEPIECESMUSTEXIST="Yes/No" RECYCLEFILEPIECES="Yes/No" />

See Also

Change Folder | Concatenate Files | Copy | Create Folder | Delete | Get Checksum | Join Files | Move | Read From File | Rename | Split File | Synchronize Folders | Touch | Write To File

Description

Joins together (merges) a file previously split into pieces using the Split File action. This action can merge split files to the original file name or join to a path and file name of your choice.

Practical Usage

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

Parameters

General Properties

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 action. 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 (i.e. file.txt.0, file.txt.1, file.txt.2, etc.). This parameter requires the path and file name of the first split file with the extension *.0 (i.e. C:\Temp\filename.txt.0).

Join to original filename

Text

No

Enabled

DESTINATIONTYPE="Original"

If enabled, the files that were created as a result of the Split File action will be joined to the original file name. When this option is enabled, the Join to different filename option is ignored. This option is enabled by default.

Join to different filename

Text

No

Disabled

DESTINATIONTYPE="Different"

If enabled, the files that were created as a result of the Split File action will be merged to a specific path and file name. When this option is enabled, the Join to original filename parameter is ignored.

Destination

Text

No

(Empty)

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

Indicates the path and file name that the originally split files will be merged onto. If the file does not exist, it will automatically be created during 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, matching destination files will be overwritten with the newly merged file. This parameter is set to NO by default.

All file pieces in span must exist

Yes/No

No

No

ALLFILEPIECESMUSTEXIST="YES"

If set to YES, all files that were originally created by the Split File action must exist 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 split files will be sent to the recycle bin when the merge is completed. This parameter is set to NO by default.

Description Properties

The Description tab allows you to customize the text description of any step as it appears in the Task Builder's Steps Pane.

More on setting custom step description

Error Causes Properties

The Error Causes tab properties lets you instruct a task step to react only to specific errors or ignore certain errors that should cause it to fail.

More on Error Causes properties

On Error Properties

The On Error tab properties lets you determine what the task should do if a particular step encounters an error as defined in the Error Causes properties.

More about On Error properties

Additional Notes

Expressions, Variables & Functions

A percent sign is used as a special character in AutoMate to indicate the beginning and end of an expression. This allows variables, functions and other expressions to be entered in any text parameter of a task's properties. For example: %1+1% inside a task will resolve to 2 at runtime. A more elaborate example is %FileDateTime(myFile)% which results to the date/time of myFile. To help construct expressions, you can open Expression Builder by clicking the Insert Expression (%) button or by pressing F2.

More on expressions

More on variables

More on functions

More on extended functions
More on the expression builder

Example

NOTE: The code below can be copied and pasted directly into the Steps pane 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" />

 

↑ [Top of Page]