if it looks like that it is NOT a csv file.
if the separator is " " space it will never work in processing,
if it is separated by [tab] it should be named data.tsv
and called with
String infile = "data/data.tsv"
Table table;
void setup() {
table = loadTable(infile,"header , tsv" );
}
but if you use csv you must use “,”
and when you post data you format it with the
</> code tag
not with the " quote tag
how is it possible that you have such a long code with class and …
without being able to read a file, are you working backward or using
other code?
if you start with table and file load your code should be
Table table;
int i, k, trows, tcols;
void setup() {
table = loadTable("test.tsv", "tsv"); // "test.csv" // "test.tsv" , "tsv" // "test.tsv" , "header , tsv"
trows=table.getRowCount();
tcols=table.getColumnCount();
println(trows + " rows/lines in table "); //(? - header ?)
println(tcols + " cols in table");
println("header: ");
for ( i =0; i < tcols; i++) {
println("col: "+i+" "+ table.getColumnTitle(i));
}
for ( k =0; k < trows; k++) {
for ( i =0; i < tcols; i++) {
println("row: "+k+" col: "+i+" string: "+table.getString(k, i));
}
}
}