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:
public static char AutoDetectCsvSeparator(
	StreamReader sr,
	int rowsToTest,
	char[] possibleSeparators


Type: System.IOStreamReader
Input StreamReader.
Type: SystemInt32
Number of rows to test.
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.
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