Class CsvParser
- Namespace
- CsvHelper
- Assembly
- CsvHelper.dll
Parses a CSV file.
public class CsvParser : IParser, IDisposable
- Inheritance
-
CsvParser
- Implements
- Inherited Members
Constructors
CsvParser(TextReader, IParserConfiguration, bool)
Initializes a new instance of the CsvParser class.
public CsvParser(TextReader reader, IParserConfiguration configuration, bool leaveOpen = false)
Parameters
reader
TextReaderThe reader.
configuration
IParserConfigurationThe configuration.
leaveOpen
boolif set to
true
[leave open].
CsvParser(TextReader, CultureInfo, bool)
Initializes a new instance of the CsvParser class.
public CsvParser(TextReader reader, CultureInfo culture, bool leaveOpen = false)
Parameters
reader
TextReaderThe reader.
culture
CultureInfoThe culture.
leaveOpen
boolif set to
true
[leave open].
Properties
ByteCount
public long ByteCount { get; }
Property Value
CharCount
public long CharCount { get; }
Property Value
Configuration
public IParserConfiguration Configuration { get; }
Property Value
Context
public CsvContext Context { get; }
Property Value
Count
public int Count { get; }
Property Value
Delimiter
public string Delimiter { get; }
Property Value
this[int]
public string this[int index] { get; }
Parameters
index
int
Property Value
RawRecord
public string RawRecord { get; }
Property Value
RawRow
public int RawRow { get; }
Property Value
Record
public string[]? Record { get; }
Property Value
- string[]
Row
public int Row { get; }
Property Value
Methods
Dispose()
public void Dispose()
Dispose(bool)
Disposes the object.
protected virtual void Dispose(bool disposing)
Parameters
disposing
boolIndicates if the object is being disposed.
ProcessEscapeField(int, int)
Processes an escaped field.
protected CsvParser.ProcessedField ProcessEscapeField(int start, int length)
Parameters
Returns
- CsvParser.ProcessedField
The processed field.
ProcessNoEscapeField(int, int)
Processes an non-escaped field.
protected CsvParser.ProcessedField ProcessNoEscapeField(int start, int length)
Parameters
Returns
- CsvParser.ProcessedField
The processed field.
ProcessRFC4180BadField(int, int)
Processes a field that does not comply with RFC4180.
protected CsvParser.ProcessedField ProcessRFC4180BadField(int start, int length)
Parameters
Returns
- CsvParser.ProcessedField
The processed field.
ProcessRFC4180Field(int, int, int)
Processes a field that complies with RFC4180.
protected CsvParser.ProcessedField ProcessRFC4180Field(int start, int length, int quoteCount)
Parameters
start
intThe start index of the field.
length
intThe length of the field.
quoteCount
intThe number of counted quotes.
Returns
- CsvParser.ProcessedField
The processed field.
Read()
public bool Read()
Returns
ReadAsync()
public Task<bool> ReadAsync()