Split File by Text Command: splitFileByText
The splitFileByText command scans the source file for a specific word or set of words and splits the content wherever the word(s) occur. This results in multiple smaller files, each containing the section of text where the split occurred.
Example: You have a file named LogFile.txt containing multiple logs, and you want to split the file into smaller files wherever the word “Error” appears.
Steps to Configure:
- Select Set a Variable Value from the Action dropdown.
- Enter a variable name in Element Key (e.g., SplitFileByTextStatus). This variable will store the status of the operation (e.g., true or false).
- Click on Form, select Functions, and choose File Handler Functions.
- In the Cmd field, select splitFileByText and provide the following parameters:
- Source: Specify the full path of the file to be split (e.g., C:\Documents\ LogFile.txt).
- Text: Enter the specific text that will trigger the file split. For example, Error.
- Click Save.


Expected Outcome:
- The original file is divided into smaller parts based on the provided text.
- Each split file contains lines containing the specified word.
- The split files follow a naming pattern: <OriginalFileName>_1.<Extension>, <OriginalFileName>_2.<Extension>, and so on (e.g., LogFile_1.txt, LogFile_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., ${SplitFileByTextStatus}).