Skip to content

Conversation

@christianbender
Copy link

@christianbender christianbender commented Jun 30, 2018

I fixed the issue #5068 (enhancement). Now we can choice a separator for the CSV-files. And open this as well.

Table table;

void setup() {

  table = loadTable("mammal2.csv", "header", ';');

  println(table.getRowCount() + " total rows in table"); 

  for (TableRow row : table.rows()) {

    int id = row.getInt("id");
    String species = row.getString("species");
    String name = row.getString("name");

    println(name + " (" + species + ") has an ID of " + id);
  }
}
  • The file mammal2.csv is now seperated with ;

Another example

Table table;

void setup() {

  table = loadTable("mammal2.csv",';');

  println(table.getRowCount() + " total rows in table"); 

  for (TableRow row : table.rows()) {

    println(row.getString(1));
  }
}

@christianbender christianbender changed the title Fixed #5068 Fixed issue #5068 Jun 30, 2018
@gohai gohai changed the title Fixed issue #5068 Add separator argument to loadTable() (#5068) Jun 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant