Visual Basic 2005 in a Nutshell (In a Nutshell (OReilly))
Location
TextFieldParser.SetDelimiters Syntax
Dim fileParser As FileIO.TextFieldParser ' ...later... fileParser.SetDelimiters(setOfDelimiters)
Description
The SetDelimiters method sets the field delimiters used in delimited text file parsing. This method also sets the TextFieldParser object's TextFieldType property to Microsoft.VisualBasic.FileIO.FieldType.Delimited. Although you can define more than one delimiter, most input files will use a single field delimiter, such as a comma or a tab character. You can use the TextFieldParser object's Delimiters property to set the delimiters as well, but that property does not alter the TextFieldType property. Usage at a Glance
Example
The following example uses the SetDelimiters method to indicate the comma character as the field delimiter. Dim scanInput As Microsoft.VisualBasic.FileIO.TextFieldParser ' ...later... scanInput.SetDelimiters(New String( ) {","}) Related Framework Entries
See Also
CommentTokens Property, Delimiters Property, FieldWidths Property, HasFieldsEnclosedInQuotes Property, ReadFields Method, SetFieldWidths Method, TextFieldParser Object, TextFieldType Property, TrimWhiteSpace Property |
Категории