
Hi experts,
I have a code to read CSV file using Comma text IO class. It works fine , however i am unable to figure out how can i customize it so that it skips reading last 2 rows of the CSV file.
Please share psuedo/full code.
Thanks
Mav
Hi Mav,
If you use newline as row delimiter, you can calculate the number of lines with TextBuffer before you start reading the file with CommaTextIO. In the while loop for CommaTextIO you can increment current line and compare it with the total number of lines.
TextBuffer textBuffer = new TextBuffer();
textBuffer.fromFile("my_file_path");
info(strFmt("%1", textBuffer.numLines()));