TextFieldParser Object


TextFieldParser Object

Location

Microsoft.VisualBasic.FileIO.TextFieldParser

Description

The TextFieldParser object simplifies the process of extracting data fields from delimited and fixed-width text data files. Existing data files are opened with the My.Computer.FileSystem.OpenTextFieldParser method, which returns an object of type TextFieldParser. You can also create a new instance of TextFieldParser directly, passing the file name as a constructor parameter. The object includes several useful members for extracting data from the data file.

You must close the TextFieldParser object when finished with it. This is normally done by calling the object's Close method. However, you can also use the Using statement to release all parser-related resources when the Using statement is complete.

     Using fileParser As New FileIO.TextFieldParser(dataFile)        ...code to parse the file goes here...     End Using 

Public Members

The following members of the TextFieldParser object have their own entries elsewhere in this chapter.

  • Close Method

  • CommentTokens Property

  • Delimiters Property

  • EndOfData Property

  • ErrorLine Property

  • ErrorLineNumber Property

  • FieldWidths Property

  • HasFieldsEnclosedInQuotes Property

  • LineNumber Property

  • PeekChars Method

  • ReadFields Method

  • ReadLine Method

  • ReadToEnd Method

  • SetDelimiters Method

  • SetFieldWidths Method

  • TextFieldType Property

  • TrimWhiteSpace Property

Related Framework Entries

  • Microsoft.VisualBasic.FileIO.TextFieldParser Class

See Also

My Namespace, OpenTextFieldParser Method




Visual Basic 2005(c) In a Nutshell
Visual Basic 2005 in a Nutshell (In a Nutshell (OReilly))
ISBN: 059610152X
EAN: 2147483647
Year: 2004
Pages: 712

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net