End of file when using readln ? (javascript eof)
Posted: April 6th, 2010, 1:51 pm
Hello all
I'm using readln to parse a text file line by line (I'd rather not use 'read' if ever I parse a large file), however I have no idea how to catch the end of the file:
The script stops if there's a blank line (two linebreaks).
Any ideas ? Short of using read?
I'm using readln to parse a text file line by line (I'd rather not use 'read' if ever I parse a large file), however I have no idea how to catch the end of the file:
Code: Select all
var myFile = File.openDialog ("Select file","*.txt");
var fileOK = myFile.open("r","TEXT","????");
while(t = myFile.readln()){
//alert(t) or whatever
};
Any ideas ? Short of using read?