Nodes/ControlFlowUtils/πŸ“„ Read Text File
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.

By VykosXΒ·Created 2 years agoΒ·Updated 2 years agoΒ· 147
πŸ“„ Read Text File
    • STRING
    β—„filefile.txtβ–Ί
    β—„line0β–Ί
    β—„on_eoftrueβ–Ί
    Category🐺 VykosX-ControlFlowUtils

    Inputs (3)

    NameTypeDefaultDescription
    fileSTRINGfile.txtAbsolute or relative path of the file to read
    lineoptINT0Line number to read within the file or '0' to read the whole file at once
    on_eofoptBOOLEANtrueAction to perform if the specified line number does not exist

    Outputs (1)

    NameTypeDescription
    STRINGSTRINGFull contents of the text file or the line of your choice