CsvReader(String, Char, Encoding, Boolean, CsvOpts) Constructor

Initializes a new CsvReader instance.

Definition

Namespace: FolkerKinzel.CsvTools
Assembly: FolkerKinzel.CsvTools (in FolkerKinzel.CsvTools.dll) Version: 2.0.1+2345335399184346d9b2cc992ed5c814406052c1
C#
public CsvReader(
	string filePath,
	char delimiter = ',',
	Encoding? textEncoding = null,
	bool isHeaderPresent = true,
	CsvOpts options = CsvOpts.Default
)

Parameters

filePath  String
File path of the CSV file.
delimiter  Char  (Optional)
The field separator character.
textEncoding  Encoding  (Optional)
The text encoding to be used to read the CSV file or null for UTF8.
isHeaderPresent  Boolean  (Optional)
true, to interpret the first line as a header, otherwise false.
options  CsvOpts  (Optional)
Options for reading the CSV file.

Exceptions

ArgumentNullExceptionfilePath is null.
ArgumentExceptionfilePath is not a valid file path.
ArgumentOutOfRangeExceptiondelimiter is either the double quotes " or a line break character ('\r' or '\n').
IOExceptionI/O error.

See Also