Skip to content

saveTable writes duplicate rows! #1734

Description

@gratefulfrog

I am sorry to report what seems to be an incredible problem with the saveTable() method.

void setup(){
  Table t =  createTable();
  t.addColumn("x");
  t.addColumn("y");
  TableRow newRow = t.addRow();
  newRow.setString("x", "a");
  newRow.setString("y", "b");
  saveTable(t,"data/data.csv", "csv"); 
}
void draw(){} 

Gives a file that looks like this:

$ cat data.csv
x,y
a,b
x,y
a,b
$

There is a workaround, though! Do not specify the file type, let processing guess by the extension!...
saveTable(t,"data/data.csv");

produces:

$ cat data.csv
x,y
a,b
$

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions