CsvReader Class

Provides read-only forward access to the records (rows) of a CSV file.

Definition

Namespace: FolkerKinzel.CsvTools
Assembly: FolkerKinzel.CsvTools (in FolkerKinzel.CsvTools.dll) Version: 2.0.1+2345335399184346d9b2cc992ed5c814406052c1
C#
public sealed class CsvReader : IDisposable, 
	IEnumerable<CsvRecord>, IEnumerable, IEnumerator<CsvRecord>, 
	IEnumerator
Inheritance
Object    CsvReader
Implements
IEnumerableCsvRecord, IEnumeratorCsvRecord, IEnumerable, IEnumerator, IDisposable

Remarks

The class implements IEnumerable<CsvRecord>. A CsvReader instance can be iterated with foreach or queried using Linq methods. Note that an instance can only be iterated once; if an attempt is made to iterate it twice, an ObjectDisposedException is thrown.

Constructors

CsvReader(TextReader, Char, Boolean, CsvOpts)Initializes a new CsvReader instance.
CsvReader(String, Char, Encoding, Boolean, CsvOpts)Initializes a new CsvReader instance.

Properties

Delimiter Gets the field separator character.
Options Gets the options for reading the CSV file.

Methods

DisposeCloses the CSV file.
EqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
GetEnumeratorReturns an enumerator that iterates through the collection.
GetHashCodeServes as the default hash function.
(Inherited from Object)
GetTypeGets the Type of the current instance.
(Inherited from Object)
ReadReturns the next CsvRecord in the CSV file or null if the file has been read completely.
ToStringReturns a string that represents the current object.
(Inherited from Object)

Explicit Interface Implementations

IEnumerableGetEnumeratorReturns an enumerator that iterates through a collection.
IEnumeratorCurrentGets the element in the collection at the current position of the enumerator.
IEnumeratorMoveNextAdvances the enumerator to the next element of the collection.
IEnumeratorReset Throws a NotSupportedException.
IEnumeratorCsvRecordCurrentGets the element in the collection at the current position of the enumerator.

See Also