This property returns the current line number in a text file.
The Line property is used to return the current line number in a text file. Upon opening a textfile and before any writing takes place, Line always returns '1'.
<%
dim filesys, text, readfile, contents, col, linumber
set filesys = CreateObject("Scripting.FileSystemObject")
Set text = filesys.CreateTextFile("c:\somefile2.txt")
text.Write "Find the last character in the text file"
text.close
set readfile = filesys.OpenTextFile("c:\somefile2.txt", 1, false)
do while readfile.AtEndOfStream <> true
contents = readfile.Read(1)
col = readfile.Column -1
linumber = readfile.Line
loop
readfile.close
Response.Write "The last character in line " linumber " is '" contents "' and its column number is '" col "'."
%>
"The last character in line 1 is 'e' and its column number is '40'."