Class CsvFileReader
Class for reading from comma-separated-value (CSV) files
public class CsvFileReader : CsvFileCommon, IDisposable
- Inheritance
-
CsvFileReader
- Implements
- Inherited Members
- Extension Methods
Constructors
CsvFileReader(Stream, string, EmptyLineBehavior)
Initializes a new instance of the CsvFileReader class for the specified stream.
public CsvFileReader(Stream stream, string lineSeparator, EmptyLineBehavior emptyLineBehavior = EmptyLineBehavior.NoColumns)
Parameters
stream
StreamThe stream to read from
lineSeparator
stringThe line separator to use.
emptyLineBehavior
EmptyLineBehaviorDetermines how empty lines are handled
CsvFileReader(TextReader, string, EmptyLineBehavior)
Initializes a new instance of the CsvFileReader class for the specified file path.
public CsvFileReader(TextReader reader, string lineSeparator, EmptyLineBehavior emptyLineBehavior = EmptyLineBehavior.NoColumns)
Parameters
reader
TextReaderThe file reader.
lineSeparator
stringThe line separator to use.
emptyLineBehavior
EmptyLineBehaviorDetermines how empty lines are handled
CsvFileReader(string, string, EmptyLineBehavior)
Initializes a new instance of the CsvFileReader class for the specified file path.
public CsvFileReader(string path, string lineSeparator, EmptyLineBehavior emptyLineBehavior = EmptyLineBehavior.NoColumns)
Parameters
path
stringThe name of the CSV file to read from
lineSeparator
stringThe line separator to use.
emptyLineBehavior
EmptyLineBehaviorDetermines how empty lines are handled
Methods
DisposeManaged()
Disposes the managed resources. Override this method to add custom clean up of managed resources.
protected override void DisposeManaged()
ReadRow(List<string>)
Reads a row of columns from the current CSV file. Returns false if no more data could be read because the end of the file was reached.
public bool ReadRow(List<string> columns)