Table

Data / Composite

Description

Stores data in rows and columns like a spreadsheet. Load with loadTable(). Column names are set by the header row.

Syntax

Table* t = loadTable("data.csv", "header")

Parameters

None

Returns

Table

Methods

addColumn(std::string name)Adds a column
addRow()Adds a new row, returns reference
getRowCount()Returns number of rows
getColumnCount()Returns number of columns
getString(int row, int col)Gets a cell value as string
getString(int row, std::string col)Gets a cell value by column name
getInt(int row, int col)Gets a cell value as int
getFloat(int row, int col)Gets a cell value as float
setString(int row, int col, std::string v)Sets a cell value
setInt(int row, int col, int v)Sets a cell value as int
setFloat(int row, int col, float v)Sets a cell value as float
removeRow(int i)Removes a row
clearRows()Removes all rows
getColumnIndex(std::string name)Returns index of a column by name

Related

Under the Hood

Implementation in Processing.h / Processing.cpp:

Loading...