Definition and Usage
This command reads the content of a text file from the specified location. It allows you to extract text data from files and store it either as a single text value or as a list where each line becomes a separate item.
Parameter Values
Input parameters
Parameter | Description | Possible Values | Required | Options / Notes |
File path | Enter the path of the file to read |
| Yes | You can manually enter a path or use the "Select file" button to browse for a file |
Read content as | Specifies how to store the text | Single text value, Text list | Yes | "Single text value" stores the entire content as one text value; "Text list" stores each line as a separate item in a list |
File encoding | Select the encoding format to read the text | System default, Utf8, Ascii, Utf8WithBom, Unicode, GBK, GB2312 | Yes | Choose the appropriate encoding that matches your file to avoid character corruption |
Error handling
Parameter Name | Description |
Throw error & stop | When an error occurs, the action will trigger an error and stop the execution of the entire app. |
Retry command | If an error occurs, the action will retry the command in an attempt to resolve the issue and continue the process. |
Ignore error & continue | When an error occurs, the action will be ignored, and the workflow will continue without interruption. |
Variables produced
This action produces a variable that stores the text content read from the file. The variable type depends on the "Read content as" setting - either a text string or a text list.
Using Variables in Conditions
Parameters with the {x} icon can accept variables from previous steps. You can use variables to dynamically specify the file path or store the output in a variable that can be used in subsequent actions. For example, you could use a variable to read different files based on certain conditions in your workflow.
Notes
Make sure the file exists at the specified path before running this command to avoid errors.
The file must be accessible with the current user permissions.
Large files may take longer to read and could impact performance.
If reading files with special characters, ensure you select the correct encoding format.
When using the "Text list" option, empty lines in the file will be included as empty items in the resulting list.