Nodes/comfyui_cv/Parse Matrix
ComfyUI Node

Parse Matrix

Parses a delimited text table into a 2-D numpy matrix. Spaces, tabs, commas or semicolons separate columns, newlines separate rows; consecutive separators are collapsed. Reads back everything 'CV Array To Text' writes (that is the round trip: format -> 'Basic data handling: save STRING to file' -> load -> parse). Rejects ragged rows (varying column counts).

By bmad4ever·Created 3 months ago·Updated 2 days ago· 0
Parse Matrix
    • nparray
    text1 2 3 4 5 6
    dtypesame as input
    transposefalse
    skip_rows0
    Categoryimage/CV/low-level

    Inputs (4)

    NameTypeDefaultDescription
    textSTRING1 2 3 4 5 6Matrix data: spaces, tabs, commas or semicolons separate columns, newlines separate rows. Consecutive separators are collapsed.
    dtypeoptCOMBOsame as inputOutput array depth. 'same as input' defaults to CV_64F (float64).
    transposeoptBOOLEANfalseSwap rows and columns (transpose the matrix).
    skip_rowsoptINT00–1024Drop this many leading lines before parsing - 1 skips a CSV header row (a header is text, so parsing one as numbers raises). Blank lines never count.

    Outputs (1)

    NameTypeDescription
    nparrayNPARRAYParsed 2-D numpy matrix.