Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

TextFieldParser.TextFieldType Property

Definition

Namespace:
Microsoft.VisualBasic.FileIO
Assembly:
Microsoft.VisualBasic.Core.dll
Assembly:
Microsoft.VisualBasic.dll
Source:
TextFieldParser.vb
Source:
TextFieldParser.vb
Source:
TextFieldParser.vb
Source:
TextFieldParser.vb
Source:
TextFieldParser.vb

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

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

public:
 property Microsoft::VisualBasic::FileIO::FieldType TextFieldType { Microsoft::VisualBasic::FileIO::FieldType get(); void set(Microsoft::VisualBasic::FileIO::FieldType value); };
public Microsoft.VisualBasic.FileIO.FieldType TextFieldType { get; set; }
member this.TextFieldType : Microsoft.VisualBasic.FileIO.FieldType with get, set
Public Property TextFieldType As FieldType

Property Value

A TextFieldType value that indicates whether the file to be parsed is delimited or fixed-width.

Examples

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

Remarks

The default value of this property is delimited.

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

To See
Read from a delimited text file How to: Read From Comma-Delimited Text Files
Read from a fixed-width text file How to: Read From Fixed-width Text Files
Read from a text file with multiple formats How to: Read From Text Files with Multiple Formats

Applies to

See also


Feedback

Was this page helpful?