CsvOpenWrite(TextWriter, Int32, Char) Method

Initializes a CsvWriter to write CSV without a header row.

Definition

Namespace: FolkerKinzel.CsvTools
Assembly: FolkerKinzel.CsvTools (in FolkerKinzel.CsvTools.dll) Version: 2.0.1+2345335399184346d9b2cc992ed5c814406052c1
C#
public static CsvWriter OpenWrite(
	TextWriter writer,
	int columnsCount,
	char delimiter = ','
)

Parameters

writer  TextWriter
The TextWriter used for writing.
columnsCount  Int32
Number of columns in the CSV.
delimiter  Char  (Optional)
The field separator character.

Return Value

CsvWriter
A CsvWriter instance that allows you to write CSV data with the TextWriter.

Remarks

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

Exceptions

ArgumentNullExceptionwriter is null.
ArgumentOutOfRangeException

columnsCount is negative.

- or -

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

See Also