I don't understand some of your logic. Why would you read the entire file then seperate it by line when you can do this
jscript code:
function ReadFile(File) {
var oLineArray = new Array();
var oFile = FileSys.OpenTextFile(File, 1 /* ForReading */, false);
while (!oFile.AtEndOfStream) oLineArray.push(oFile.ReadLine());
return oLineArray;
}