DelimitedColumnDelimiter: String;
The DelimitedColumnDelimiter property determines the symbol, used as a field delimiter in the text file. By default the property is set to ",quot;.
The following values are acceptable as a value of this property:
,
;
.
:
|
{Tabulation} - code #9
{Carriage return} - code #13
{Row transfer} - code #10
{Carriage return}{Row transfer} - #13+#10
Any other symbol, or a combination of symbols, optional for user.
Executing the example requires that the repository contains an ETL task with the Etl identifier.
Sub UserProc;
Var
MB: IMetabase;
MObj: IMetabaseObject;
EtlTask: IEtlTask;
EtlConsumer: IEtlPlainDataConsumer;
TextConsumer: IDtTextConsumer;
WxConsumer: IWxRectangle;
WxETLConsumer: IWxETLObject;
Begin
MB := MetabaseClass.Active;
//Search task ETL. Object repository with identifier "ETL"
MObj := MB.ItemById("Etl").Edit;
EtlTask := MObj As IEtlTask;
//Start creation consumer
//Create the Export to text object
EtlConsumer := EtlTask.Create(EtlObjectType.PlainDataTextConsumer) As IEtlPlainDataConsumer;
EtlConsumer := EtlConsumer.Edit;
EtlConsumer.Id := "Text_Consumer";
EtlConsumer.Name := "Export in text";
EtlConsumer.Description := "Export in text";
//Adjustment consumer data
TextConsumer := EtlConsumer.Consumer As IDtTextConsumer;
TextConsumer.File := "c:\Data_out.txt";
TextConsumer.WriteHeader := True;
TextConsumer.RowDelimiter := #13 + #10; //Return carriage + transfer row
TextConsumer.DelimitedColumnDelimiter := #9; //Button Tab
TextConsumer.DelimitedTextQualifier := "'";
EtlConsumer.FillDefault;
//Save consumer
EtlConsumer.Save;
//End creation consumer
//Start creation visual object
WxConsumer := EtlTask.Workspace.CreateRectangle;
WxETLConsumer := New WxETLObject.Create;
WxETLConsumer.ETLObject := EtlConsumer;
WxConsumer.Style.TextPosition := WxTextPosition.Bottom;
WxConsumer.Style.PictureMarginTop := -10;
WxConsumer.PinPosition := New GxPointF.Create(50, 50);
WxConsumer.Extension := WxETLConsumer As IWxShapeExtension;
//End creation visual object
//Save task Etl
MObj.Save;
End Sub UserProc;
After executing the example the Export to text object is created in the ETL task. During export the Carriage return+Row transfer combination is used as a row delimiter, and Tabulation symbol - as a field delimiter. Apostrophe is a text delimiter. Field names are exported in the first file row. If the file does not exist it is created.
See also: