Table of Contents

Interface IParser

Namespace
CsvHelper
Assembly
CsvHelper.dll

Defines methods used the parse a CSV file.

public interface IParser : IDisposable
Inherited Members

Properties

ByteCount

Gets the count of how many bytes have been read. CountBytes needs to be enabled for this value to be populated.

long ByteCount { get; }

Property Value

long

CharCount

Gets the count of how many characters have been read.

long CharCount { get; }

Property Value

long

Configuration

Gets the configuration.

IParserConfiguration Configuration { get; }

Property Value

IParserConfiguration

Context

Gets the reading context.

CsvContext Context { get; }

Property Value

CsvContext

Count

Gets the number of fields for the current row.

int Count { get; }

Property Value

int

Delimiter

The delimiter the parser is using.

string Delimiter { get; }

Property Value

string

this[int]

Gets the field at the specified index for the current row.

string this[int index] { get; }

Parameters

index int

The index.

Property Value

string

The field.

RawRecord

Gets the raw record for the current row.

string RawRecord { get; }

Property Value

string

RawRow

Gets the raw row the parser is currently on.

int RawRow { get; }

Property Value

int

Record

Gets the record for the current row. Note: It is much more efficient to only get the fields you need. If you need all fields, then use this.

string[]? Record { get; }

Property Value

string[]

Row

Gets the CSV row the parser is currently on.

int Row { get; }

Property Value

int

Methods

Read()

Reads a record from the CSV file.

bool Read()

Returns

bool

True if there are more records to read, otherwise false.

ReadAsync()

Reads a record from the CSV file asynchronously.

Task<bool> ReadAsync()

Returns

Task<bool>

True if there are more records to read, otherwise false.