www.csvreader.com

CsvDataReader overview

Public Static (Shared) Methods

Parse Creates a CsvDataReader object using a string of data as the source. Uses Default as the encoding.

Public Instance Constructors

CsvDataReaderOverloaded. Initializes a new instance of the CsvDataReader class.

Public Instance Properties

Columns Collection of columns to include in the source data.
Comment The character to use as a comment signal. Default is pound, '#'.
Delimiter The character to use as the column delimiter. Default is comma, ','.
EscapeMode Specifies how to escape an occurance of system characters, like the TextQualifier and Delimiter, inside field values when required. Default is Doubled.
HasHeaders Indicates whether the first line of data contains names of the columns. Default is false.
RecordDelimiter The character to use as the record delimiter. Default is combination of standard end of line characters for Windows, Unix, or Mac.
SafetySwitch Safety caution to prevent the parser from using large amounts of memory in the case where parsing settings like file encodings don't end up matching the actual format of a file. This switch can be turned off if the file format is known and tested. With the switch off, the max column lengths and max column count per record supported by the parser will greatly increase. Default is true.
SkipEmptyRecords Whether to treat a record with no data as if it wasn't there or not. When set to true, two consecutive occurances of the record delimiter will be treated as only one. When set to true, when the reader encounters an empty record, all fields will contain their corresponding column's default value. Default is true.
TextQualifier The character to use as a text qualifier in the data. Default is quote, '"'.
TrimWhitespace Whether to trim leading and trailing whitespace characters from non-textqualified column data. Default is true.
UseComments Whether to look for comments while parsing or not. Default is false.
UseTextQualifier Whether to use a text qualifier while parsing or not. Default is true.

Public Instance Methods

Close Closes and releases all related resources.
Equals (inherited from Object)Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object)Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object)Gets the Type of the current instance.
ToString (inherited from Object)Returns a String that represents the current Object.

Public Instance Events

ReadRecord This event is raised after each record has been read and before the values have been converted to the destination type. This event can be used to modify values in a record, add values to a record, or skip a record entirely.

Explicit Interface Implementations

IDataReader.GetSchemaTable
IDataReader.NextResult
IDataReader.Read
IDataRecord.GetBoolean
IDataRecord.GetByte
IDataRecord.GetBytes
IDataRecord.GetChar
IDataRecord.GetChars
IDataRecord.GetData
IDataRecord.GetDataTypeName
IDataRecord.GetDateTime
IDataRecord.GetDecimal
IDataRecord.GetDouble
IDataRecord.GetFieldType
IDataRecord.GetFloat
IDataRecord.GetGuid
IDataRecord.GetInt16
IDataRecord.GetInt32
IDataRecord.GetInt64
IDataRecord.GetName
IDataRecord.GetOrdinal
IDataRecord.GetString
IDataRecord.GetValue
IDataRecord.GetValues
IDataRecord.IsDBNull
IDisposable.Dispose

See Also

CsvDataReader Class | Csv Namespace