SplitFile Command: splitFile
The splitFile command divides a file into smaller files based on a specified number of lines. This helps manage large datasets, improve processing efficiency, and facilitate data handling in automation workflows.
Example: Suppose you have a file C:\Data\LargeFile.txt and you want to split it into smaller files, each containing 5 lines.
Steps to configure:
- Select Set a Variable from the Action dropdown.
- Enter a variable name in the Element Key field (e.g., SplitStatus). This variable will store the result.
- Click on Form to open the configuration window.
- Select Functions from the dropdown, then choose File handler Functions as the function.
- In the Cmd field, select splitFile.
- Provide the following parameters:
- Source: Path to the file to be split (e.g., C:\Data\LargeFile.txt).
- LineNos: Number of lines per split file (e.g., 5).
- Click Save.


Outcome:
- The specified file is divided into smaller parts based on the number of lines per split.
- The split files are named sequentially in the format <OriginalFileName>_1.<Extension>, <OriginalFileName>_2.<Extension>, and so on (e.g., LargeFile_1.txt, LargeFile_2.txt, and so on).
- The operation status (true or false) is stored in the variable defined in the Element Key field.
- This variable can be used in later steps of your automation process to reference the stored information using the syntax ${VariableName} (e.g., ${SplitStatus}).