Split File Action

Declaration

<AMSPLITFILE FILE="text" DESTINATION="text" SIZETYPE="FLOPPY" SIZE="1.44" BYTETYPE="MB" />

See Also

Join File Action, Concatenate Files Action, Copy File Action, Delete File Action, Rename File Action, Touch File Action

Description

Splits the specified file into pieces (or sections) of a fixed size. These file pieces can make the original file easier to distribute. The pieces can later be re-joined using the Join File action.

Practical Usage

Usually used to split a particularly large file into sections in order to allow easier transmission of the original file, such as through FTP or as attachments to an e-mail.

Parameters

File to split

Text, Required
MARKUP:
a) FILE="c:\sourcefoldername\file.txt"
b) FILE="file.txt"

Specifies the file to split. This can be a fully qualified path and file name (preferred) or a single file (requires use of the Change Folder action).

Folder for split files

Text, Required
MARKUP:
DESTINATION="c:\destfoldername\

Specifies the destination folder in which to place the newly split files. Each newly split file will include a period followed by a number added to the original filename (i.e. file.txt.0, file.txt.1, etc.)

Individual file piece size

Text, Required
MARKUP:SIZETYPE="FLOPPY" SIZE="1.44" BYTETYPE="MB"

Specifies the size of each individually split file. The available drop-down list options are:

NOTE: The minimum file piece size is 4 KB. If the individual file piece size selected is more than the size of the file specified, an error will occur.

Size

Text, Required
MARKUP:SIZE="40"

Specifies the size of each individually split file. This parameter is available only when Other is selected under the Individual file piece size parameter and is used in conjunction with the Byte Type parameter.

NOTE: The minimum file piece size is 4 KB. If the individual file piece size selected is more than the size of the file specified, an error will occur.

Byte type

Text, Required
MARKUP:BYTETYPE="MB"

Specifies the byte type of each individually split file. This parameter is available only when Other is selected under the parameter Individual file piece size and is used in conjunction with the Size parameter. The available options are:

Notes

Custom Description

This action includes the Description tab for entering a custom step description.

More on setting custom step description

Standard Error Handling Options

This action also includes the standard Error Causes and On Error failure handling options/tabs.

More on Error Handling Options

Variables and Expressions

All text fields allow the use of expressions, which can be entered by surrounding the expression in percentage signs (example: %MYVARIABLE%, %Left('Text',2)%). To help construct these expressions, you can open Expression Builder from these fields by pressing F2.

More on variables
More on expressions

More on the expression builder

Example

NOTE: The code below can be copied and pasted directly into the Steps pane of the Task Builder.

<AMSPLITFILE FILE="C:\Temp\File1.txt" DESTINATION="C:\Test" SIZETYPE="OTHER" SIZE="20" BYTETYPE="KB" />