Node reference
Read file
Read an opened file by line or all at once
Read an opened file by line or all at once
Part of Files / Files. This reference is generated from the node definitions shipped with Blokboard.
When to use it#
- Read the contents of an opened text file.
Parameters#
| Parameter | Field type | Default | Description |
|---|---|---|---|
File (file) | file-reference | {{file.output}} | Opened file to read. |
Read mode (mode) | select | line | |
Encoding (encoding) | select | utf-8 | |
On failure (onFailure) | select | stop | Choose whether a failed execution stops the workflow or only ends this path. |
Retry attempts (retryCount) | number | 0 | How many additional attempts to make after the first failure. |
Read mode: Choices: One line per execution (line), All lines in one execution (all).
Encoding: Choices: UTF-8 (utf-8), Windows-1252 (windows-1252), UTF-16 LE (utf-16le). Available under More options.
On failure: Choices: Stop workflow (stop), Continue (continue). Available under More options.
Retry attempts: Available under More options. Limits: minimum 0; no declared maximum.
Inputs#
| Port | Value | Description |
|---|---|---|
in | any | Trigger or an opened file reference. |
Outputs#
| Port | Value | Description |
|---|---|---|
out | any | One line execution, or one execution containing all lines. |
done | object | Emitted after every read execution and its downstream path complete. |
out fields#
| Field | Type | Description |
|---|---|---|
line | string | Current line. |
lineNumber | number | Current line number, starting at 1. |
lines | array | Every line when Read mode is All lines. |
text | string | Complete text when Read mode is All lines. |
lineCount | number | Number of lines. |
The out port emits a separate execution for each item.
done fields#
| Field | Type | Description |
|---|---|---|
lineCount | number | Number of lines read. |
file | file | The opened runtime file. |
The done port waits for the descendant paths of out to finish.
Use in a workflow#
Connect this node to the path that should execute it. Run a small example, inspect its actual output, and use the expression picker to select values for later nodes.
See expressions for mapping values, workflow basics for connections, and troubleshooting for failed runs.