Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with Readline?

Status
Not open for further replies.

rtnMichael

Programmer
Aug 5, 2002
152
US
Hey, I'm trying to read in a txt file to grab information in VBscripting, but when I read a line that begins with a "'", it doesn't grab the line....here's what I have including the file being read...am I doing something wrong?

----MyDummy.txt
'dummy config file for Test

PARAM
'11010
12010
13010
13020
------------

dim ParmArr(2000)

set FSObj = Server.CreateObject("Scripting.FileSystemObject")

Set TSObj = FSObj.OpenTextFile ("MyDummy.txt", 1)

max_parms = 1

while not TSObj.AtEndOfStream
readvar = TSObj.Readline

ParmArr(max_parms) = readvar
max_parms = max_parms + 1
wend

----This prints out
lines 1 and 2 nothing

line 3--- PARAM
line 4 nothing
line 5--- 12010
line 6--- 13010
line 7--- 13020

-----------------

Lines 1 and 4 should be printing out the line, but it fails to do so I would assume because of the tick mark at the beginning...Any clues???

Thanks
Mike
 
because ' is a comment,

you could try doing a readall()

and then split the file contents up into an array using VbCrLf and the delimiter.
 
Hello rtnMichael,

Readline should not be held responsible. I see using server.createobject, so it may be your asp scripts to print it over to the client's console that refuses/filters the commented lines.

regards - tsuji
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top