# Find EOF on CSV file

**URL:** <https://discourse.processing.org/t/find-eof-on-csv-file/13807>\
**Category:** Coding Questions\
**Created:** [September 4, 2019, 10:28pm UTC](https://discourse.processing.org/t/find-eof-on-csv-file/13807 "2019-09-04T22:28:27Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![GuilhermeVolker](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/guilhermevolker/32/5657_2.png) [@GuilhermeVolker](https://discourse.processing.org/u/GuilhermeVolker)\
**Post date:** [September 4, 2019, 10:28pm UTC](https://discourse.processing.org/t/find-eof-on-csv-file/13807/1 "2019-09-04T22:28:27Z")

</div>

Hi.  
I have to find the EOF (end of the file) in javaScript. I have try’d some possibilities without success.

```auto
let i = myFile.realine();
if(myFile == EOF){
...
}

```

with this code appears the following message:  
TypeError: table.readline is not a function

Is there some command in p5? I couldn’t find on reference

---

<div class="post-metadata">

**Author:** ![kll](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kll/32/964_2.png) [@kll](https://discourse.processing.org/u/kll)\
**Post date:** [September 4, 2019, 11:17pm UTC](https://discourse.processing.org/t/find-eof-on-csv-file/13807/2 "2019-09-04T23:17:11Z")

</div>

sorry, but why not use  
[https://p5js.org/reference/#/p5/loadTable](https://p5js.org/reference/#/p5/loadTable)  
get the whole file to a table

---

<div class="post-metadata">

**Author:** ![GuilhermeVolker](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/guilhermevolker/32/5657_2.png) [@GuilhermeVolker](https://discourse.processing.org/u/GuilhermeVolker)\
**Post date:** [September 4, 2019, 11:54pm UTC](https://discourse.processing.org/t/find-eof-on-csv-file/13807/3 "2019-09-04T23:54:57Z")

</div>

I am. But i have to take each value, when reaches the end of the file i receive an error message. The only way is to avoid that is to know when to file end. Sorry i didn’t make it clear early.

---

<div class="post-metadata">

**Author:** ![kll](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kll/32/964_2.png) [@kll](https://discourse.processing.org/u/kll)\
**Post date:** [September 5, 2019, 12:03am UTC](https://discourse.processing.org/t/find-eof-on-csv-file/13807/4 "2019-09-05T00:03:54Z")

</div>

sorry, i still not get it,  
after using loadTable you not talk to the file anymore,  
you talk to the table and now it is not mytable.readline?? its about ROW

[https://editor.p5js.org/kll/sketches/Nk3OjSYa2](https://editor.p5js.org/kll/sketches/Nk3OjSYa2)

```auto
function check_table() {
  print(data.getRowCount() + ' total (data) rows in table');
  print(data.getColumnCount() + ' total columns in table');

  for (var r = 0; r < data.getRowCount(); r++)
    for (var c = 0; c < data.getColumnCount(); c++)
      print("row " + r + " col " + c + " column "+data.columns[c]+" : " + data.getString(r, c));
}

```

---

<div class="post-metadata">

**Author:** ![GuilhermeVolker](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/guilhermevolker/32/5657_2.png) [@GuilhermeVolker](https://discourse.processing.org/u/GuilhermeVolker)\
**Post date:** [September 5, 2019, 12:13am UTC](https://discourse.processing.org/t/find-eof-on-csv-file/13807/5 "2019-09-05T00:13:06Z")

</div>

I am able to do what i have to with this function:  
test\_data.getRowCount();

thank you very much for your help 😉
