The TextStream facilitates sequential access to a file.
Returns TRUE if the file pointer immediately precedes the end-of-line marker in a TextStream file.
object.AtEndOfLine
Boolean.
Read-only.
See sample in Example
Returns TRUE if the file pointer is at the end of a TextStream file.
object.AtEndOfStream
Boolean.
Read-only.
This example TRUE if the file pointer is at the end of the textstream in file TEST.TXT.
<% Set FSO = CreateObject("Scripting.FileSystemObject")
Set TextStream = FSO.opentextfile("sys:nsn\user\test.txt")
Do while (TextStream.AtEndOfStream = FALSE)
Response.Write TextStream.Readline
Loop
Textstream.Close %>
Returns the column number of the current character position in a TextStream file.
object.Column
Integer.
Read-only.
This example opens a text file and returns the position of the file pointer.
<% Set FSO = CreateObject("Scripting.FileSystemObject")
Set Textstream = FSO.opentextfile("sys:nsn\user\profit.txt")
Response.Write TextStream.Column
Textstream.Read (5)
Response.Write Textstream.Column
Textstream.Close %>
Returns the current line number in a TextStream file.
object.Line
Long.
Read-only.
This example returns a number, which is line where the file pointer is placed.
<% Set FSO = CreateObject("Scripting.FileSystemObject")
Set Textstream = FSO.opentextfile("sys:nsn\user\profit.txt")
Response.Write TextStream.Line
Textstream.close() %>
Closes an open TextStream file.
object.Close
None.
Boolean.
See sample in Example.
Reads a specified number of characters from a TextStream file and returns the resulting string.
object.Read(
Character As Long)
String.
See sample in Example.
Reads an entire TextStream file and returns the resulting string.
object.ReadAll
None.
String.
The maximum size of the returned string is 10 KB.
This example returns TEST.TXT.
<% Set FSO = CreateObject("Scripting.FileSystemObject")
Set Textstream = FSO.OpenTextFile("sys:nsn\user\test.txt")
Response.Write TextStream.ReadAll()
Textstream.close() %>
Reads an entire line (excluding the newline character) where the pointer is present in a TextStream file and returns the resulting string.
object.ReadLine
None.
String.
See sample in Example.
Skips a specified number of characters when reading a TextStream file.
object.Skip(
Character As Long)
Void.
The file pointer will be placed after 10 characters in the textstream PROFIT.TXT.
<% Set FSO = CreateObject("Scripting.FileSystemObject")
Set Textstream = FSO.OpenTextFile("sys:nsn\user\test.txt")
Response.Write TextStream.Skip (10)
Textstream.close() %>
Skips to the next line while reading a TextStream file.
object.SkipLine
None.
Void.
The file pointer is placed in the next line w.r.t to the current position in the textstream PROFIT.TXT.
<% Set FSO = CreateObject("Scripting.FileSystemObject")
Set Textstream = FSO.OpenTextFile("sys:nsn\user\test.txt")
Response.Write TextStream.SkipLine()
Textstream.close() %>
Writes a specified string from the position where the pointer is placed in a TextStream file.
object.Write(
Text As Variant)
Boolean.
Writes a specified string and a newline character from the position where the pointer is placed in a TextStream file.
object.WriteLine([
Text As Variant])
Boolean.
Writes a specified number of newline characters at the position where the pointer is placed in a TextStream file.
object.WriteBlankLines(
Lines As Long)
Boolean.