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
but it says that the addColumn function does not exist.
I used to have the v3 and I thought updating it to the v4 (4.1.1) it would work. I already deleted the v3 folder thinking it was overlapping but the same error keeps appearing.
Runs ok here with Processing 4.1.1; comma separated file is saved in ‘data’ folder. I always thought that this was a deceiving demo name. You never see a table unless you open the .csv file with a spreadsheet app.
If it works for the both of you, maybe the problem lies in my laptop. I’ll try and delete the v4 and downloading it again. Move the folder to another place and see what happens.
Now it works. I had to change the name of the file to the same as the folder where it was. Oops.
Now that I have that solved, I have to go back to the code that I was originally working on and finish solving it :v. Thanks people!
I don’t worry about where the Processing app is installed on a Mac; it automatically goes in the Applications folder. Windows is a different cat; would go in C:\ProgramFiles I’m guessing. Problem is it starts off in the Downloads folder and has to be moved from where it starts. Makes a difference if it is a .zip file or an .exe, then we get into ‘extracting’ and directing where it goes. I like my Mac.