Table table;
void setup() {
table = loadTable("data.csv", "header");
println(table.getColumnCount() + " total Columns in table");
for (TableRow row : table.rows()) {
int years = row.getInt("Jahr");
int total = row.getInt("Insgesamt");
println("In the year " + years + " there were " + total + " students in total.");
}
}
Even though in my data it clearly says “Jahr” and “Insgesamt”, somehow it’s not recognizing the names, and it’s saying there’s only 1 column when there are actually two.
I had converted my excel data to csv and that’s how it got converted. So to fix it, I opened the csv in notes, copy-paste each row in a single box in excel (one above the other) and replaced “;” with “,”.
Thank you very much for your help!