Page 1 of 1

writing text file contents into a recordset

Posted: Thu Oct 31, 2002 2:07 pm
by noguru
How can I speed up the process of reading from text files? I use fopen to open the file and then loop through each line to check something using while(!feof). I use 2 very large text files and it takes forever to finally load my next page with the results. Is there a way (and how?) to create recordsets on the server and load the contents of the files into these? This way I might be able to filter a recordset by using a WHERE clause (for instance "SELECT * FROM rs2 WHERE ID=$row1['StudentNumber']"), instead of having to loop through each and every record.

Please help!

Posted: Thu Oct 31, 2002 10:16 pm
by SuperHuman
Well, you are using a sluggish while loop to loop the data. Are you just searching for a string inside this file, or multiple strings or what are you searching for. Show some code so we can provide an efficient solution to your problem.....