Solved

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

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

Technology Partners: 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

When it comes to writing scripts for a Client/Server computing environment it is essential to consider some way of enabling the authentication functionality within a script. This sort of consideration mainly comes into the picture when we are dealin…
Over the years I have built up my own little library of code snippets that I refer to when programming or writing a script.  Many of these have come from the web or adaptations from snippets I find on the Web.  Periodically I add to them when I come…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…
Suggested Courses

751 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