FireDAC.Comp.BatchMove.TFDBatchMove.GuessFormat

From RAD Studio API Documentation
Jump to: navigation, search

[–] Properties
Type:
procedure
function
Visibility: public
Source:
FireDAC.Comp.BatchMove.pas
FireDAC.Comp.BatchMove.hpp
Unit: FireDAC.Comp.BatchMove
Parent: TFDBatchMove

Delphi

procedure GuessFormat(AAnalyze: TFDBatchMoveAnalyze = [taDelimSep, taHeader, taFields]);

C++

void __fastcall GuessFormat(TFDBatchMoveAnalyze AAnalyze = (TFDBatchMoveAnalyze() << TFDBatchMoveAnalyzeItem::taDelimSep << TFDBatchMoveAnalyzeItem::taHeader << TFDBatchMoveAnalyzeItem::taFields ));

Description

Use the GuessFormat method to automatically recognize the data source format.

GuessFormat only applies to the data sources without associated metadata, such as TFDBatchMoveTextReader. As a result of the recognition, the reader obtains the necessary metadata to process the data source as a data table. AAnalyze argument controls the parts of the metadata to recognize. See TFDBatchMoveAnalyze for details.

The first line of text data is considered a header in the following situation.

  • All items of the first line look like a string, and one of the following is met:
    • When the text data has only a single line.
    • When all characters in the first line are upper-cased.
    • When any item of the text AnalyzeSample lines contain a value that does not look like a string.

Another option is to use the Analyze property. When Analyze is not empty, the GuessFormat method is automatically called by the Execute method.

The automatic recognition uses rule-based prediction, which cannot guarantee an absolutely correct recognition in all cases. In such cases, an application may call the GuessFormat method and then verify the recognition results. In case of using a TFDBatchMoveTextReader the application may verify and adjust the DataDef property value.

See Also