amitbansal
8 years agoOccasional Contributor
aqFile LinesCount fails to work
here is my function where I am using LinesCount and facing issue, language used is JScript function getLines(){ var sapFile; sapFile = aqFile.OpenTextFile("PHOENIX_ACTUALS", aqFile.faRead, aqFil...
- 8 years ago
Thanks for your reply.
when I use the FS object as in below function it reads the lines and I am able to count the lines in count variable.
function ReadFile(AFileName)
{
const ForReading = 1;
let FS = Sys.OleObject("Scripting.FileSystemObject");
let F = FS.OpenTextFile(AFileName, ForReading);
count =0;while(! F.AtEndOfStream){
let s = F.ReadLine();
count++;}
F.Close();
}