public static CsvReader<TResult> OpenReadAnalyzed<TResult>(
string filePath,
CsvTo<TResult> converter,
Encoding? defaultEncoding = null,
Header header = Header.ProbablyPresent,
int analyzedLines = 5
)
Public Shared Function OpenReadAnalyzed(Of TResult) (
filePath As String,
converter As CsvTo(Of TResult),
Optional defaultEncoding As Encoding = Nothing,
Optional header As Header = Header.ProbablyPresent,
Optional analyzedLines As Integer = 5
) As CsvReader(Of TResult)
public:
generic<typename TResult>
static CsvReader<TResult>^ OpenReadAnalyzed(
String^ filePath,
CsvTo<TResult>^ converter,
Encoding^ defaultEncoding = nullptr,
Header header = Header::ProbablyPresent,
int analyzedLines = 5
)
static member OpenReadAnalyzed :
filePath : string *
converter : CsvTo<'TResult> *
?defaultEncoding : Encoding *
?header : Header *
?analyzedLines : int
(* Defaults:
let _defaultEncoding = defaultArg defaultEncoding null
let _header = defaultArg header Header.ProbablyPresent
let _analyzedLines = defaultArg analyzedLines 5
*)
-> CsvReader<'TResult>
The method performs a statistical analysis on the CSV file. The result of the analysis is therefore always only an estimate, the accuracy of which increases with the number of lines analyzed.
The field delimiters COMMA (',', %x2C), SEMICOLON (';', %x3B), HASH ('#', %x23), TAB ('\t', %x09), and SPACE (' ', %x20) are recognized automatically.
This method also tries to determine the Encoding of the CSV file from the byte order mark (BOM). If no byte order mark can be found, defaultEncoding is used.
ArgumentNullException | filePath, or converter is null. |
ArgumentOutOfRangeException | header is not a defined value of the Header enum. - or - header is a combination of Header values. |
CsvFormatException | Invalid CSV file. Try to increase the value of analyzedLines to get a better analyzer result! |