Split File

Declaration

<AMSPLITFILE FILE="text" DESTINATION="text" SIZETYPE="text(options)" SIZE="number" BYTETYPE="text(options)" />

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 - Split File

Declaration

<AMSPLITFILE FILE="text" DESTINATION="text" SIZETYPE="text(options)" SIZE="number" BYTETYPE="text(options)" />

See Also

Create Folder | Touch File | Set Attributes | Read from File | Write to File | Synchronize Folders | Concatenate Files

Description

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

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 e-mail attachments.

Parameters

General Properties

Property

Type

Req'd

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 action).

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.

Overwrite Existing File

Yes/No

No

Bytes

BYTETYPE="MB"

The type of byte that should be used to measure the value specified in the Size parameter. The available options are:

  • Bytes (Default)

  • KB

  • MB

  • GB

This parameter is available only if the option Other is selected from the Individual file piece size parameter.

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: Split file "C:\FolderName\FileName.txt" into parts of "OTHER" and place the parts into directory "C:\Folder2". Each file size is  "20 MB".

 

<AMSPLITFILE FILE="C:\FolderName\FileName.txt" DESTINATION="C:\Folder2" SIZETYPE="OTHER" SIZE="20" BYTETYPE="MB" />

 

↑ [Top of Page]