# Get value from specific column in last row

**URL:** <https://discourse.processing.org/t/get-value-from-specific-column-in-last-row/36250>\
**Category:** Beginners\
**Created:** [April 10, 2022, 12:23pm UTC](https://discourse.processing.org/t/get-value-from-specific-column-in-last-row/36250 "2022-04-10T12:23:31Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![oZeppy](https://avatars.discourse-cdn.com/v4/letter/o/b5e925/32.png) [@oZeppy](https://discourse.processing.org/u/oZeppy)\
**Post date:** [April 10, 2022, 12:23pm UTC](https://discourse.processing.org/t/get-value-from-specific-column-in-last-row/36250/1 "2022-04-10T12:23:31Z")

</div>

Hi. I’m trying to find the last value in a column and print it. I’ve tried

```auto
table.getRowCount.getString

```

but can’t get it to work, it says getRowCount doesn’t exist.  
Sorry if this is very basic.

---

<div class="post-metadata">

**Author:** ![SomeOne](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/someone/32/8639_2.png) [@SomeOne](https://discourse.processing.org/u/SomeOne)\
**Post date:** [April 10, 2022, 2:49pm UTC](https://discourse.processing.org/t/get-value-from-specific-column-in-last-row/36250/2 "2022-04-10T14:49:53Z")

</div>

getRowCount() returns number of rows in the table. To get the last row of the table would be `table.getRow(table.getRowCount))` and there might be the traditional indexing error. If table row indexing starts from zero you might need to decrease getRowCount() by one.

---

<div class="post-metadata">

**Author:** ![oZeppy](https://avatars.discourse-cdn.com/v4/letter/o/b5e925/32.png) [@oZeppy](https://discourse.processing.org/u/oZeppy)\
**Post date:** [April 10, 2022, 6:17pm UTC](https://discourse.processing.org/t/get-value-from-specific-column-in-last-row/36250/3 "2022-04-10T18:17:19Z")

</div>

I tried that and it prints “processing.data.Table$RowPointer@” and 8 alphanumeric characters.

---

<div class="post-metadata">

**Author:** ![SomeOne](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/someone/32/8639_2.png) [@SomeOne](https://discourse.processing.org/u/SomeOne)\
**Post date:** [April 10, 2022, 6:50pm UTC](https://discourse.processing.org/t/get-value-from-specific-column-in-last-row/36250/4 "2022-04-10T18:50:44Z")

</div>

Because it’s not data, it’s a reference to the last row. You need to refer to a column on the row too get data. [Reference / Processing.org](https://processing.org/reference/Table_getString_.html)

This would print value from column ‘name’ on the last row

```auto
println(table.getString(table.getRow(table.getRowCount)), "name"));

```

---

<div class="post-metadata">

**Author:** ![oZeppy](https://avatars.discourse-cdn.com/v4/letter/o/b5e925/32.png) [@oZeppy](https://discourse.processing.org/u/oZeppy)\
**Post date:** [April 10, 2022, 7:05pm UTC](https://discourse.processing.org/t/get-value-from-specific-column-in-last-row/36250/5 "2022-04-10T19:05:04Z")

</div>

getString expects int,int. How would I address that?

---

<div class="post-metadata">

**Author:** ![SomeOne](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/someone/32/8639_2.png) [@SomeOne](https://discourse.processing.org/u/SomeOne)\
**Post date:** [April 11, 2022, 10:23am UTC](https://discourse.processing.org/t/get-value-from-specific-column-in-last-row/36250/6 "2022-04-11T10:23:42Z")

</div>

There are two getSrings (int, int) and (int,string). You can use either. If you look for values in a named column you use (int, string). If you want to loop through all columns on a row you use (int, int). If you look at table reference [Reference / Processing.org](https://processing.org/reference/Table.html) you can find all functions and under function you can find code examples.  
There is also

```auto
table.getColumnCount()

```

which gives you amount of columns in the table
