File System - Split file

Declaration

<AMFILESYSTEM ACTIVITY="split_file" FILE="text" DEST="text" SIZETYPE="text (options)" SIZE="number" BYTETYPE="text (options)" />

Related Topics    

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)

  1. FILE="c:\folder\file.txt"

  2. FILE="file.txt"

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 (i.e. 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:

  • Floppy Disk (1.44 MB) (Default)

  • CD-R 74-min (640 MB)

  • CD-R 80-min (700 MB)

  • DVD single layer (4.7 GB)

  • DVD double layer (8.5 GB)

  • Other

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:

  • Bytes (Default) - Data will be measured in bytes. A byte contains 8 bits (single binary digits: 1 or 0)

  • KB -  Data will be measured in kilobytes. A kilobyte contains 1,024 bytes.

  • MB -  Data will be measured in megabytes. A megabyte contains 1,024 kilobytes.

  • GB -  Data will be measured in gigabytes. A gigabyte contains 1,024 gigabytes.

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

Split file "C:\FolderName\FileName.txt" into parts of "OTHER" and place the parts into directory "C:\Folder2". Each file size is  "20 MB".

Copy
<AMFILESYSTEM ACTIVITY="split_file" FILE="C:\FolderName\FileName.txt" DEST="C:\Folder2" SIZETYPE="other" SIZE="20" BYTETYPE="mb" />