hi,
i have a text file to read and parse, it is a feed of a massive size with some 250,000 lines.
I know how to read the file and parse it but I am wondering if it is possible to read lets say the first 1000 lines, delete those first 1000 lines from the text file and do the same again several times until the file is empty.
i work in ASP
JS mostly, here is the script I have to go through each line.
Code:
//Create a filesystem object
var FSO = Server.CreateObject("Scripting.FileSystemObject")
//Map the logical path to the physical system path
//var Filepath = (Server.MapPath("feed/textfile.txt"));
var Filepath = (Server.MapPath("feed/LSItitleTI.txt"));
//Open the file
var TextStream = FSO.OpenTextFile(Filepath)
for (i=0;TextStream.AtEndOfStream==false;i++)
{
//parse and add to the database
}
Also, is there a way to know the number of lines in the file, i have tried with an array type but it did not work out for me.
many thanks