File System - Split file
Declaration
<AMFILESYSTEM ACTIVITY="split_file" FILE="text" DEST="text" SIZETYPE="text (options)" SIZE="number" BYTETYPE="text (options)" />
Description
Splits the specified file into pieces (or sections) of a fixed size. The pieces can later be re-joined using the Join file activity.
Practical usage
Commonly used to split a particularly large file into sections in order to make the original file easier to distribute or transport, such as through FTP or as email attachments.
Parameters
General
Property | Type | Required | Default | Markup | Description |
---|---|---|---|---|---|
File to split | Text | Yes | (Empty) |
|
Indicates
the file to split. The size of the file must be larger than 4
KB in order for it to be split. You can enter a fully qualified
path and file name (preferred) or a file name only (requires use
of the Change folder
activity). NOTE:
If the size selected in the Individual
file piece size parameter is greater than the size of the
file to split, an error will occur. |
Folder for split files | Text | Yes | (Empty) | DESTINATION="C:\FolderName" | The destination folder in which to place the newly split files. Files created as a result of the split will include a period followed by a number added to the original file name starting with .0 (for example, file.txt.0, file.txt.1, file.txt.2, etc.) |
Individual file piece size | Text (options) | Yes | Floppy | SIZETYPE="FLOPPY" | The
size of each individually split file. The number of split file
pieces that are created is determined by the individual file piece
size specified. 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 | Number | No | (Empty) | SIZE="5"" | The size of each individually split file. This parameter is available only if Other is selected from the Individual file piece size parameter. It is used in conjunction with the Byte Type parameter. |
Byte type | Text (options) | No | Bytes | BYTETYPE="MB" | The
byte data that should be used to measure the value specified in
the Size parameter. This
parameter is available only if the option Other
is selected from the Individual
file piece size parameter. The available options are:
|
Example
- Copy and paste the sample AML code below directly into the Task Builder Steps Panel.
- To successfully run the sample code, update parameters containing user credentials, files, file paths, or other information specific to the task to match your environment.
Description
Split file "C:\FolderName\FileName.txt" into parts of "OTHER" and place the parts into directory "C:\Folder2". Each file size is "20 MB".
<AMFILESYSTEM ACTIVITY="split_file" FILE="C:\FolderName\FileName.txt" DEST="C:\Folder2" SIZETYPE="other" SIZE="20" BYTETYPE="mb" />