Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

TextFieldParser.SetDelimiters Method

Sets the delimiters for the reader to the specified values, and sets the field type to Delimited.

Namespace:  Microsoft.VisualBasic.FileIO
Assembly:  Microsoft.VisualBasic (in Microsoft.VisualBasic.dll)

public void SetDelimiters(
	params string[] delimiters
)

Parameters

delimiters
Type: System.String[]

Array of type String.

ExceptionCondition
ArgumentException

A delimiter is zero-length.

The existing contents of the Delimiters property are cleared when this method is set.

This method provides a way to set delimiters without creating an array.

The following table lists an example of a task involving the SetDelimiters method.

This example opens a text field parser and defines the delimiter as vbTab.

Using FileReader As New Microsoft.VisualBasic.FileIO.
    TextFieldParser("C:\logs\test.log")

    FileReader.SetDelimiters(vbTab)
End Using

Replace the path C:\logs\test.log with the path and name of the file you wish to parse.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Show:
© 2015 Microsoft