Upraviť

Zdieľať cez


TextFieldParser.TextFieldType Property

Definition

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