This reference is for Processing 2.0+. If you have a previous version, use the reference included with your software. If you see any errors or have suggestions, please let us know. If you prefer a more technical reference, visit the Processing Javadoc.
| Name | Table |
||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Examples |
Table table;
void setup() {
table = new Table();
table.addColumn("id");
table.addColumn("species");
table.addColumn("name");
TableRow newRow = table.addRow();
newRow.setInt("id", table.lastRowIndex());
newRow.setString("species", "Panthera leo");
newRow.setString("name", "Lion");
saveTable(table, "data/new.csv");
}
// Sketch saves the following to a file called "new.csv":
// id,species,name
// 0,Panthera leo,Lion
| ||||||||||||||||||||||||||||||||||||||||||||
| Description | Table objects store data with multiple rows and columns, much like in a traditional spreadsheet. Tables can be generated from scratch, dynamically, or using data from an existing file. Tables can also be output and saved to disk, as in the example above. | ||||||||||||||||||||||||||||||||||||||||||||
| Methods |
| ||||||||||||||||||||||||||||||||||||||||||||
| Constructor | Table() Table(rows) | ||||||||||||||||||||||||||||||||||||||||||||
| Related | loadTable() saveTable() TableRow |
