Class for reading from comma-separated-value (CSV) files. More...
Public Member Functions | |
CsvFileReader (Stream stream, EmptyLineBehavior emptyLineBehavior=EmptyLineBehavior.NoColumns) | |
Initializes a new instance of the CsvFileReader class for the specified stream. More... | |
CsvFileReader (string path, EmptyLineBehavior emptyLineBehavior=EmptyLineBehavior.NoColumns) | |
Initializes a new instance of the CsvFileReader class for the specified file path. More... | |
bool | ReadRow (ref List< string > columns) |
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. More... | |
void | Dispose () |
Additional Inherited Members | |
Public Types inherited from SpringCard.LibCs.CsvFileCommon | |
enum | EmptyLineBehavior { EmptyLineBehavior.NoColumns, EmptyLineBehavior.EmptyColumn, EmptyLineBehavior.Ignore, EmptyLineBehavior.EndOfFile } |
Determines how empty lines are interpreted when reading CSV files. These values do not affect empty lines that occur within quoted fields or empty lines that appear at the end of the input file. More... | |
Protected Attributes inherited from SpringCard.LibCs.CsvFileCommon | |
char [] | SpecialChars = new char[] { ';', ',', '"', '\r', '\n' } |
These are special characters in CSV files. More... | |
Properties inherited from SpringCard.LibCs.CsvFileCommon | |
char | Delimiter [get, set] |
Gets/sets the character used for column delimiters. | |
char | Quote [get, set] |
Gets/sets the character used for column quotes. | |
Class for reading from comma-separated-value (CSV) files.
SpringCard.LibCs.CsvFileReader.CsvFileReader | ( | Stream | stream, |
EmptyLineBehavior | emptyLineBehavior = EmptyLineBehavior.NoColumns |
||
) |
Initializes a new instance of the CsvFileReader class for the specified stream.
stream | The stream to read from |
emptyLineBehavior | Determines how empty lines are handled |
SpringCard.LibCs.CsvFileReader.CsvFileReader | ( | string | path, |
EmptyLineBehavior | emptyLineBehavior = EmptyLineBehavior.NoColumns |
||
) |
Initializes a new instance of the CsvFileReader class for the specified file path.
path | The name of the CSV file to read from |
emptyLineBehavior | Determines how empty lines are handled |
bool SpringCard.LibCs.CsvFileReader.ReadRow | ( | ref List< string > | columns | ) |
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.
columns | Collection to hold the columns read |