If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Updating a text file with asp

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-29-09, 13:20
oliflorence oliflorence is offline
Registered User
 
Join Date: Aug 2004
Posts: 96
Updating a text file with asp

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
Reply With Quote
  #2 (permalink)  
Old 07-06-09, 12:10
Teddy Teddy is offline
Purveyor of Discontent
 
Join Date: Mar 2003
Location: The Bottom of The Barrel
Posts: 6,071
Look in to the "ReadLine" method.
__________________
oh yeah... documentation... I have heard of that.

*** What Do You Want In The MS Access Forum? ***
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On