# IllegalArgumentException: This table has no column named ' '

**URL:** <https://discourse.processing.org/t/illegalargumentexception-this-table-has-no-column-named/40464>\
**Category:** Coding Questions\
**Created:** [January 5, 2023, 5:08pm UTC](https://discourse.processing.org/t/illegalargumentexception-this-table-has-no-column-named/40464 "2023-01-05T17:08:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sabisiiuuu](https://avatars.discourse-cdn.com/v4/letter/s/5f8ce5/32.png) [@sabisiiuuu](https://discourse.processing.org/u/sabisiiuuu)\
**Post date:** [January 5, 2023, 5:08pm UTC](https://discourse.processing.org/t/illegalargumentexception-this-table-has-no-column-named/40464/1 "2023-01-05T17:08:44Z")

</div>

Hello there!

So, I have the following csv table:

```auto
Jahr;Insgesamt
2022;17392
2021;18037
2020;18515
2019;18351
2018;17695
2017;16745
2016;16088
2015;15083
2014;14316
2013;13241
2012;12158
2011;11147

```

And this is my code:

```auto

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.

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [January 5, 2023, 5:13pm UTC](https://discourse.processing.org/t/illegalargumentexception-this-table-has-no-column-named/40464/2 "2023-01-05T17:13:44Z")

</div>

> [@sabisiiuuu](#):
>
> `"data.csv"`

I think columns need to be separated with `,` not with `;`

see [loadTable() / Reference / Processing.org](https://processing.org/reference/loadTable_.html)

---

<div class="post-metadata">

**Author:** ![sabisiiuuu](https://avatars.discourse-cdn.com/v4/letter/s/5f8ce5/32.png) [@sabisiiuuu](https://discourse.processing.org/u/sabisiiuuu)\
**Post date:** [January 5, 2023, 6:20pm UTC](https://discourse.processing.org/t/illegalargumentexception-this-table-has-no-column-named/40464/3 "2023-01-05T18:20:55Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [January 6, 2023, 12:15pm UTC](https://discourse.processing.org/t/illegalargumentexception-this-table-has-no-column-named/40464/4 "2023-01-06T12:15:51Z")

</div>

unrelated to the , / ; problem: A small Sketch to parse a String to a table:

```auto
//

String [] list = {
  "Jahr,Insgesamt", 
  "2022,17392", 
  "2021,18037", 
  "2020,18515", 
  "2019,18351", 
  "2018,17695", 
  "2017,16745", 
  "2016,16088", 
  "2015,15083", 
  "2014,14316", 
  "2013,13241", 
  "2012,12158", 
  "2011,11147"
};

Table table;

void setup() {
  size(200, 100); 

  table = parseToTable(list);

  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.");
  }
}

// -----------------------------------------------------------------------------------------------------------------------

Table parseToTable(String[] listLocal) {

  Table tableLocal = new Table();

  tableLocal.addColumn("Jahr");
  tableLocal.addColumn("Insgesamt");

  for (String s1 : listLocal) {
    String[] s2=split(s1, ",");
    if (isNotANumber(s2[0])) {
      println("skipped "
        + s1
        + " (not a number) " );
      continue;
    }
    if (s2.length != 2) {
      println("skipped "
        + s1
        + " (column count != 2)");
      continue;
    }

    TableRow newRow = tableLocal.addRow();
    newRow.setString("Jahr", s2[0]);
    newRow.setString("Insgesamt", s2[1]);
  }//for 

  // table = loadTable("data.csv", "header");

  return tableLocal;
}//func

boolean isNotANumber(String s ) {
  return 
    ! (s.charAt(0) > '0' && s.charAt(0) < '9');
}

//

```
