1

I am trying to get the RowCount of a specific column in my .csv file.

Table table;

float temperature = 15;

void setup() {
  size(displayWidth, 800);

table = loadTable("data/wetterAppSentences.csv", "header");

if (temperature <= 7){
  TableRow row = table.getRow(random(table.getRowCount()));
  
}
}

I tried using the header of my column to define it but .getRowCount() doesn't expect any arguments.

  • With `Table` you can only get the total number of columns, but you can't get a specific column. You can only get a list of rows. [`getRowCount()`](https://processing.org/reference/Table_getRowCount_.html) "Returns the **total** number of rows in a Table.". You might need to flip your problem around so you think of it in terms rows first instead of columns. (Once you get a `TableRow` you can check how columns it has via `yourRow.getColumnCount()` for example) – George Profenza Feb 06 '23 at 17:10

0 Answers0