Property:  TextStream.Column

Implemented in version 2.0

The Column property returns the current position of the file pointer within the current line. Column 1 is the first character in each line.

The follwing code uses the Column property to get the column number of the last character in a text file.

dim filesys, text, readfile, contents
set filesys = CreateObject("Scripting.FileSystemObject")
Set text = filesys.CreateTextFile("c:\somefile2.txt")
text.Write "Find the last character in the text file"
set readfile = filesys.OpenTextFile("c:\somefile2.txt", 1, false)
do while readfile.AtEndOfStream <> true
    contents = readfile.Read(1)
    col = readfile.Column -1
Response.Write "The last character in the text file is '" & contents & "' and its_
                                column number is '" & col & "'."

"The last character in the text file is 'e' and its column number is '40'."

Copyright 1999-2001 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information