C# Class FileHelpers.Detection.SmartFormatDetector

Utility class used to auto detect the record format, the number of fields, the type, etc.
Afficher le fichier Open project: MarcosMeli/FileHelpers Class Usage Examples

Private Properties

Свойство Type Description
AdjustConfidence void
AreAllHeaders bool
CreateDelimiterOptions void
CreateFixedLengthCandidates List
CreateFixedLengthFields void
CreateFixedLengthOptions void
CreateMixedOptions void
DetectIfContainsHeaders bool
DetectOptionals void
DetectQuoted void
DetectTypes void
GetDelimiterInfo FileHelpers.Detection.DelimiterInfo
GetDelimiters List
GetSampleLines string[][]
GetSampleLines string[][]
HeadersInData bool
JoinFixedColCandidates List
NumberOfLines int
SameFirstLine bool
SameHeaders bool

Méthodes publiques

Méthode Description
DetectFileFormat ( IEnumerable files ) : FileHelpers.Detection.RecordFormatInfo[]

Tries to detect the possible formats of the file using the FormatHint

DetectFileFormat ( IEnumerable files ) : FileHelpers.Detection.RecordFormatInfo[]

Tries to detect the possible formats of the file using the FormatHint

DetectFileFormat ( string file ) : FileHelpers.Detection.RecordFormatInfo[]

Tries to detect the possible formats of the file using the FormatHint

SmartFormatDetector ( ) : System

Initializes a new instance of the SmartFormatDetector class.

Private Methods

Méthode Description
AdjustConfidence ( FileHelpers.Detection.RecordFormatInfo format, FileHelpers.Detection.DelimiterInfo info ) : void
AreAllHeaders ( string rowData ) : bool
CreateDelimiterOptions ( string sampleData, List res, char delimiter = '\0' ) : void
CreateFixedLengthCandidates ( string lines ) : List
CreateFixedLengthFields ( string data, FileHelpers.Dynamic.FixedLengthClassBuilder builder ) : void
CreateFixedLengthOptions ( string data, List res ) : void
CreateMixedOptions ( string data, List res ) : void
DetectIfContainsHeaders ( FileHelpers.Detection.DelimiterInfo info, string sampleData ) : bool
DetectOptionals ( FileHelpers.Detection.RecordFormatInfo option, string data ) : void
DetectQuoted ( FileHelpers.Detection.RecordFormatInfo format, string data ) : void
DetectTypes ( FileHelpers.Detection.RecordFormatInfo format, string data ) : void
GetDelimiterInfo ( string data, char delimiter ) : FileHelpers.Detection.DelimiterInfo

Calculate statistics based on sample data for the delimitter supplied

GetDelimiters ( string data ) : List
GetSampleLines ( IEnumerable files, int nroOfLines ) : string[][]
GetSampleLines ( IEnumerable files, int nroOfLines ) : string[][]
HeadersInData ( DelimiterInfo info, string headerValues, string rows ) : bool
JoinFixedColCandidates ( List cand1, List cand2 ) : List
NumberOfLines ( string data ) : int
SameFirstLine ( DelimiterInfo info, string sampleData ) : bool
SameHeaders ( DelimiterInfo info, string line1, string line2 ) : bool

Method Details

DetectFileFormat() public méthode

Tries to detect the possible formats of the file using the FormatHint
public DetectFileFormat ( IEnumerable files ) : FileHelpers.Detection.RecordFormatInfo[]
files IEnumerable The files to be used as sample data
Résultat FileHelpers.Detection.RecordFormatInfo[]

DetectFileFormat() public méthode

Tries to detect the possible formats of the file using the FormatHint
public DetectFileFormat ( IEnumerable files ) : FileHelpers.Detection.RecordFormatInfo[]
files IEnumerable The files to be used as sample data
Résultat FileHelpers.Detection.RecordFormatInfo[]

DetectFileFormat() public méthode

Tries to detect the possible formats of the file using the FormatHint
public DetectFileFormat ( string file ) : FileHelpers.Detection.RecordFormatInfo[]
file string The file to be used as sample data
Résultat FileHelpers.Detection.RecordFormatInfo[]

SmartFormatDetector() public méthode

Initializes a new instance of the SmartFormatDetector class.
public SmartFormatDetector ( ) : System
Résultat System