ComfyUI Node
π Read Text File
This node receives a file path and reads the contents of the file into a string buffer in the UTF-8 format and returns the data read. If a given Line number is specified, only that line will be returned. If Line is 0, the entire file will be read as plaintext and returned. If On_EOF is set to Ignore, Line numbers larger than exist within the file will be silently ignored and the node will return an empty string. Otherwise an error will be raised to alert the user. HOVER OVER THE INPUTS AND OUTPUTS FOR MORE INFO.
π Read Text File
- STRING
βfilefile.txtβΊ
βline0βΊ
βon_eoftrueβΊ
CategoryπΊ VykosX-ControlFlowUtils
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| file | STRING | file.txt | Absolute or relative path of the file to read |
| lineopt | INT | 0 | Line number to read within the file or '0' to read the whole file at once |
| on_eofopt | BOOLEAN | true | Action to perform if the specified line number does not exist |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| STRING | STRING | Full contents of the text file or the line of your choice |