public static TResult[] ParseAnalyzed<TResult>(
string csv,
CsvMapping mapping,
Func<Object, TResult> conversion,
Header header = Header.ProbablyPresent,
int analyzedLines = 5
)
Public Shared Function ParseAnalyzed(Of TResult) (
csv As String,
mapping As CsvMapping,
conversion As Func(Of Object, TResult),
Optional header As Header = Header.ProbablyPresent,
Optional analyzedLines As Integer = 5
) As TResult()
public:
generic<typename TResult>
static array<TResult>^ ParseAnalyzed(
String^ csv,
CsvMapping^ mapping,
Func<Object^, TResult>^ conversion,
Header header = Header::ProbablyPresent,
int analyzedLines = 5
)
static member ParseAnalyzed :
csv : string *
mapping : CsvMapping *
conversion : Func<Object, 'TResult> *
?header : Header *
?analyzedLines : int
(* Defaults:
let _header = defaultArg header Header.ProbablyPresent
let _analyzedLines = defaultArg analyzedLines 5
*)
-> 'TResult[]
A function that converts the content of mapping to an instance of TResult.
The function is called for each row in csv and gets the CsvMapping as argument, filled with the current CsvRecord instance. The CsvMapping is passed to the function as dynamic argument: Inside the function the registered DynamicProperty instances can be used like regular .NET properties, but without IntelliSense ("late binding").
CsvAnalyzer performs a statistical analysis on csv. 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.
ArgumentNullException | csv, or mapping, or conversion 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! |
FormatException | Parsing fails and Throwing is true. |