Find EOF on CSV file

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

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

1 Like

sorry, but why not use
get the whole file to a table

1 Like

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.

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

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));

I am able to do what i have to with this function:

thank you very much for your help :wink:

1 Like