Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add separator argument to loadTable() (#5068) #5564

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Add separator argument to loadTable() (#5068) #5564

wants to merge 3 commits into from

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.

None yet

1 participant