PDA

View Full Version : Counting Lines in a Text File


admin
05-28-2003, 11:59 PM
<%
whichfile = server.mappath("YOURFILENAME.txt")
Set fs = CreateObject("Scripting.FileSystemObject")
Set thisfile = fs.OpenTextFile(whichfile, 1, False)
counter = 0

Do While Not thisfile.AtEndOfStream
counter = counter + 1
thisline = thisfile.readline
loop

thisfile.Close
Set thisfile = Nothing
Set fs = Nothing
%>