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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Input Past end of file

Status
Not open for further replies.
May 31, 2007
31
0
0
AE
Hi

I was wondering if anyone can point out the reason i am getting "800A003E / Input past end of file errors". I am unable to figure out why I get this error.

Thanks


fspec="C:\input.txt"
fspec1="C:\output.txt"
LineToSkip = 10

Set fso=createobject("scripting.filesystemobject")
Set ots=fso_OpenTextfile(fspec,1)
X = ""
do While Not ots.AtEndOfStream

For count = 1 To LineToSkip Step 1
ots.SkipLine
Next

tmpstr = ots.ReadLine & vbNewLine
X = X & tmpstr

Loop

ots.close
Set ots=Nothing
Set fso=Nothing

WScript.Echo tmpstr

Set fso=createobject("scripting.filesystemobject")
Set ots=fso.Createtextfile(fspec1,2,true)
ots.Write(X)
ots.close
Set ots=Nothing
Set fso=Nothing
 
Are you sure that C:\input.txt has at least 11 lines ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top