Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

TextFieldParser Members

Provides methods and properties for parsing structured text files.

The following tables list the members exposed by the TextFieldParser type.

  Name Description
Public method TextFieldParser Overloaded. Initializes a new instance of the TextFieldParser class.
Top
  Name Description
Public property CommentTokens Defines comment tokens. A comment token is a string that, when placed at the beginning of a line, indicates that the line is a comment and should be ignored by the parser.
Public property Delimiters Defines the delimiters for a text file.
Public property EndOfData Returns True if there are no non-blank, non-comment lines between the current cursor position and the end of the file.
Public property ErrorLine Returns the line that caused the most recent MalformedLineException exception.
Public property ErrorLineNumber Returns the number of the line that caused the most recent MalformedLineException exception.
Public property FieldWidths Denotes the width of each column in the text file being parsed.
Public property HasFieldsEnclosedInQuotes Denotes whether fields are enclosed in quotation marks when parsing a delimited file.
Public property LineNumber Returns the current line number, or returns -1 if no more characters are available in the stream.
Public property TextFieldType Indicates whether the file to be parsed is delimited or fixed-width.
Public property TrimWhiteSpace Indicates whether leading and trailing white space should be trimmed from field values.
Top
(see also Protected Methods )
  Name Description
Public method Close Closes the current TextFieldParser object.
Public method Dispose Overloaded. Releases resources used by the TextFieldParser object.
Public method Equals  Overloaded. Determines whether two Object instances are equal. (Inherited from Object.)
Public method GetHashCode  Serves as a hash function for a particular type. GetHashCode is suitable for use in hashing algorithms and data structures like a hash table. (Inherited from Object.)
Public method GetType  Gets the Type of the current instance. (Inherited from Object.)
Public method PeekChars Reads the specified number of characters without advancing the cursor.
Public method ReadFields Reads all fields on the current line, returns them as an array of strings, and advances the cursor to the next line containing data.
Public method ReadLine Returns the current line as a string and advances the cursor to the next line.
Public method ReadToEnd Reads the remainder of the text file and returns it as a string.
Public method Static ReferenceEquals  Determines whether the specified Object instances are the same instance. (Inherited from Object.)
Public method SetDelimiters Sets the delimiters for the reader to the specified values, and sets the field type to Delimited.
Public method SetFieldWidths Sets the delimiters for the reader to the specified values and the field type to FixedWidth.
Public method ToString  Returns a String that represents the current Object. (Inherited from Object.)
Top
  Name Description
Protected method Dispose Overloaded. Releases resources used by the TextFieldParser object.
Protected method Finalize Overridden. Allows the TextFieldParser object to attempt to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
Protected method MemberwiseClone  Creates a shallow copy of the current Object. (Inherited from Object.)
Top

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.