Collect the concept from here:
var myFile = File.openDialog("Choose a tab delimitted txt file:");
var myArray = 
The issue with your code is that you are using readln and since it reads lines demarcated by newline and the last line does not have a new line after it, that line is skipped.
A better way would be to read the whole file into a string and then split it up on new line character, something like mentioned below.
var f = new File("Path to your file") f.open("r") var c = f.read() var a = c.split("\n") //In case the line ends with a new line character you will have a blank line in the last entry. Check it and purge it
Hope this helps
Thank you for your reply... But my doubt is , if I use the same code for the below case its working. How it is ??
Is there is any reason behind the end character is "F"? Because if i append any character with that without any other changes its returning that row contents. How it is??
If its the reason, it should not return the last row contents know? is it right??
- Sudha K
You mean to say this new screenshot that you pasted reads all the lines using readln even if the last line is not terminated by a new line? If so send me the file i can have a look
Yes... I don't know the reason for that so only posted to know the reason..
I don't know how to attach file here. I created this file in mas os textEdit.
Upload the file on dropbox or gdrive and post the link here.
When u using this kind of csv, is it working correctly for u?
Can u pls create csv using textedit ..
What is dropbox and post it here.. Can u pls explain the steps?
It works as expected and described by me in my first reply. I would like to see your document to understand what you are seeing different. Google dropbox you would find it is
Thank you for your reply..
Currently i could not able to access the url for dropbox. So i could not able to post the csv file.
Can i upload the file using forum by attach file?