This documentation is archived and is not being maintained.

TextFieldParser.TextFieldType Property 

Indicates whether the file to be parsed is delimited or fixed-width.


' Usage
Dim value As FieldType = TextFieldParserObject.TextFieldType
' Declaration
Public Property TextFieldType As FieldType

The default value of this property is delimited.

The following table lists examples of tasks involving the TextFieldType property.

This example creates a TextFieldParser, FileReader, and specifies that it is delimited.

Using FileReader As New _
Microsoft.VisualBasic.FileIO.TextFieldParser("C:\ParserText.txt")
    FileReader.TextFieldType = _
    Microsoft.VisualBasic.FileIO.FieldType.Delimited
    FileReader.SetDelimiters(",")
End Using

This example creates a TextFieldParser, FileReader, and specifies that it is fixed-width.

Using FileReader As New _
Microsoft.VisualBasic.FileIO.TextFieldParser("C:\ParserText.txt")
    FileReader.TextFieldType = _
    Microsoft.VisualBasic.FileIO.FieldType.FixedWidth
    FileReader.FieldWidths = New Integer() {5, 10, 11, -1}
End Using

Namespace: Microsoft.VisualBasic.FileIO

Class: TextFieldParser

Assembly: Visual Basic Runtime Library (in Microsoft.VisualBasic.dll)

No permissions are required.

Show: