Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Scripting.FileSystemObject  - ReadLine() refuses to read the entire textfile

Posted on 2008-10-14
4
Medium Priority
?
959 Views
Last Modified: 2012-05-05
The scripts final purpose is to execute a series of SQL statements for import of data into a database, but since it is not the problem i have only attached a small code sample that i need help with.

if you go to
http://windkin.dk/progress.asp
you can try and upload the attached csv file. The file will be correctly uploaded. I checked by opening the uploaded version and all 10000 lines are there.
After upload the user is directed to http://windkin.dk/importer.asp
This is where the problem starts. When the script have read 3150 lines it just stop. It is not because of a timeout.
In this "version" i output the data to the browser window
Can anyone guess what is going wrong.
<html>
<head>
<title>Untitled Document</title>
</head>
<body>
<%
Server.ScriptTimeout = 1200
Set fs=Server.CreateObject("Scripting.FileSystemObject")
Set f=fs.opentextfile("c:\www\windkin.dk\" & request.QueryString("filnavn"),1)
 
do while f.AtEndOfLine = false
	Response.Write(f.ReadLine)
	Response.Write("<br />")
loop
 
f.Close
Set f=Nothing
Set fs=Nothing
%>
</body>
</html>

Open in new window

0
Comment
Question by:rene_christensen
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 5

Expert Comment

by:si_shamil
ID: 22710671
I think the loop condition should be "f.AtEndOfStream" and not "f.AtEndOfLine"
0
 
LVL 31

Expert Comment

by:merowinger
ID: 22712095
also write
do while not f.AtEndOfStream
...
loop
0
 

Author Comment

by:rene_christensen
ID: 22718833
Changed the loop to this with no change::
do while not f.AtEndOfStream
      Response.Write(f.ReadLine)
      Response.Write("<br />")
loop
0
 

Accepted Solution

by:
rene_christensen earned 0 total points
ID: 23212903
unfortunatly I have not been able to find a solution for this question.
Can I close unanswered question, or what should I do?
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I met Paul Devereux (@pdevereux) today when I responded to his tweet asking “Anybody know how to automate adding files from disk to a folder in #outlook  ?”.  I replied back and told Paul that using automation, in this case scripting, to add files t…
Introduction During my participation as a VBScript contributor at Experts Exchange, one of the most common questions I come across is this: "I have a script that runs against only one computer. How can I make it run against a list of computers in …
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question