CsvOpenRead(TextReader, Char, Boolean, CsvOpts) Method

Initializes a CsvReader instance.

Definition

Namespace: FolkerKinzel.CsvTools
Assembly: FolkerKinzel.CsvTools (in FolkerKinzel.CsvTools.dll) Version: 2.0.1+2345335399184346d9b2cc992ed5c814406052c1
C#
public static CsvReader OpenRead(
	TextReader reader,
	char delimiter = ',',
	bool isHeaderPresent = true,
	CsvOpts options = CsvOpts.Default
)

Parameters

reader  TextReader
The TextReader with which the CSV data is read.
delimiter  Char  (Optional)
The field separator character.
isHeaderPresent  Boolean  (Optional)
true to interpret the first line as a header, otherwise false.
options  CsvOpts  (Optional)
Options for reading CSV.

Return Value

CsvReader
A CsvReader that allows you to iterate through the CSV data.

Remarks

When importing CSV data from Excel, the appropriate arguments can be determined with GetExcelArguments.

Exceptions

ArgumentNullExceptionreader is null.
ArgumentOutOfRangeExceptiondelimiter is either the double quotes " or a line break character ('\r' or '\n').

See Also