IDtTextProvider.DelimitedColumnDelimiters

Syntax

DelimitedColumnDelimiters: Array;

Description

The DelimitedColumnDelimiters property determines the rows array, used as a field delimiter in the text file.

Comments

As an array elements the following values are acceptable:

If any symbol from the array coincides with DelimitedTextQualifier or RowDelimiter property value, it is not regarded as a field separator.

Example

Executing the example requires a text file C:\Test.txt. There are four fields in the file, separated with the ;, : and ! symbols (semicolon, colon, and exclamation mark).

Text of the C:\Test.txt file, for which the example is written

Sub UserProc;
Var
    TextProv: IDtTextProvider;
    TextCons: IDtTextConsumer;
    DelimArr: Array[0..2Of String;
Begin
    TextProv := New DtTextProvider.Create;
    TextCons := New DtTextConsumer.Create;
    TextProv.File := "C:\Test.txt";
    TextProv.RangeHasHeader := True;
    DelimArr[0] := ";";
    DelimArr[1] := ":";
    DelimArr[2] := "!";
    TextProv.DelimitedColumnDelimiters := DelimArr;
    TextProv.GetFieldsFromFile;
    TextCons.File := "C:\Test_result.txt";
    TextCons.WriteHeader := True;
    TextCons.Fields.Add;
    TextCons.Fields.Add;
    TextCons.Fields.Add;
    TextCons.Fields.Add;
    TextCons.PutProvider(TextProv);
End UserProc;

After executing the example data from the file C:\Test.txt is loaded into the file C:\Test_result.txt, with symbol "," as fields delimiter.

Text of the C:\Test_result.txt file, which is obtained after executing the example

See also:

IDtTextProvider