Table to DataTree

Converts multiline tabular text into a Grasshopper DataTree.

JSON Masterplan (Beta) Nickname: ParseTable

Overview

Converts multiline tabular text into a Grasshopper DataTree.

Inputs (2)

  • TableData (Text): Multiline text panel (Paste from Excel).
  • ByColumn (Boolean): True = Branches are Columns. False = Rows.

Outputs (1)

  • DataTree (Generic): The structured Grasshopper DataTree.

Method, assumptions and simplifications

The same notes appear in the component's Info output.

Method

  1. Splits TableData into lines (empty lines dropped) and each line into cells by tab if the text contains any tab, otherwise by comma.
  2. Each trimmed cell is parsed as a number with invariant culture (dot decimal point, no thousands separators): whole numbers that fit a 32-bit integer become integers, others decimals, the rest text.
  3. ByColumn True puts each column in its own branch (one branch per column index); False puts each row in its own branch.

Assumptions

  • Text pasted from Excel (tab separated) or simple CSV with no quoted fields.

Simplifications and limits

  • Quoted CSV fields, commas inside cells and empty rows are not handled; ragged rows give branches of different lengths.

Workflow

  • Panel with a pasted table -> TableData -> Recipe JSON Builder or Master JSON Config Builder inputs.