SpringCard LibCs for .NET  18.10.10
A set of utilities to simplify the development of .NET application
SpringCard.LibCs.CsvFileReader Class Reference

Class for reading from comma-separated-value (CSV) files. More...

Inheritance diagram for SpringCard.LibCs.CsvFileReader:
SpringCard.LibCs.CsvFileCommon

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.
 

Detailed Description

Class for reading from comma-separated-value (CSV) files.

Constructor & Destructor Documentation

◆ CsvFileReader() [1/2]

SpringCard.LibCs.CsvFileReader.CsvFileReader ( Stream  stream,
EmptyLineBehavior  emptyLineBehavior = EmptyLineBehavior.NoColumns 
)

Initializes a new instance of the CsvFileReader class for the specified stream.

Parameters
streamThe stream to read from
emptyLineBehaviorDetermines how empty lines are handled

◆ CsvFileReader() [2/2]

SpringCard.LibCs.CsvFileReader.CsvFileReader ( string  path,
EmptyLineBehavior  emptyLineBehavior = EmptyLineBehavior.NoColumns 
)

Initializes a new instance of the CsvFileReader class for the specified file path.

Parameters
pathThe name of the CSV file to read from
emptyLineBehaviorDetermines how empty lines are handled

Member Function Documentation

◆ ReadRow()

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.

Parameters
columnsCollection to hold the columns read

The documentation for this class was generated from the following file: