Solved

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

Posted on 2008-10-14
4
935 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
  • 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Welcome back!  My apologies for taking so long to write part two of this series; it's been a long time coming!  As I promised in Part 1, this article will focus on how to locate those elusive AD properties that you are searching for.  Why is this us…
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…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

759 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now