Dela via


TextFieldParser.HasFieldsEnclosedInQuotes Property

Denotes whether fields are enclosed in quotation marks when parsing a delimited file.

' Usage
Dim value As Boolean = TextFieldParserObject.HasFieldsEnclosedInQuotes
' Declaration
Public Property HasFieldsEnclosedInQuotes As Boolean

Property Value

Boolean.

Remarks

This is an advanced member; it does not show in IntelliSense unless you click the All tab.

If the property is True, the parser assumes that fields are enclosed in quotation marks (" ") and may contain line endings.

If a field is enclosed in quotation marks, for example, abc, "field2a,field2b", field3 and this property is True, then all text enclosed in quotation marks will be returned as is; this example would return abc|field2a,field2b|field3. Setting this property to False would make this example return abc|"field2a|field2b"|field3.

Example

This example sets the HasFieldsEnclosedInQuotes property to True for myReader.

FileReader.TextFieldType = Microsoft.VisualBasic.FileIO.FieldType.Delimited
FileReader.Delimiters = New String() {","}
FileReader.CommentTokens = New String() {""}
FileReader.HasFieldsEnclosedInQuotes = True

Requirements

Namespace:Microsoft.VisualBasic.FileIO

Class:TextFieldParser

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

Permissions

No permissions are required.

See Also

Reference

TextFieldParser Object

TextFieldParser.HasFieldsEnclosedInQuotes