Click or drag to resize
ExcelFileAutoDetectCsvSeparator Method (StreamReader, Int32, Char)
Autodetects CSV separator. If there's no separators in the input stream returns (char)0.

Namespace:  GemBox.Spreadsheet
Assembly:  GemBox.Spreadsheet (in GemBox.Spreadsheet.dll) Version: 41.3.30.1033
Syntax
public static char AutoDetectCsvSeparator(
	StreamReader sr,
	int rowsToTest,
	char[] possibleSeparators
)

Parameters

sr
Type: System.IOStreamReader
Input StreamReader.
rowsToTest
Type: SystemInt32
Number of rows to test.
possibleSeparators
Type: SystemChar
Chars that can be CSV separators.

Return Value

Type: Char
Char that is CSV separator. If there's no separators in the input StreamReader returns (char)0, and if there are two with equal number of occurance, returns first of them.
Remarks
This method counts the number of occurrences of chars that are specified in the array possibleSeparators, and returns one that has occurred the most times in first rowsToTest rows of StreamReader sr.
See Also