WRITE.CSV

Write data to a text format such as CSV, TXT, TAB or any other separated text-format.

Properties

From

Name of the Input Data Source.
The input-source must always be from the neutral Table-format.

To

Name of the Output Data Source.
The output-source can contain either a File-path, a PBinaryStream object or a .Net Stream object. See WRITE.* Property "To" for more information's and examples.
The format of the output will written as a text-file with data, and possibly header separated by defined characters etc.

Parameters

@Context

Specifies in which form to produce data in the document.
The context is specified as follows: 'Header/Separator/Qualifier/NumberFormat/DateFormat'

  • Header
    1 with header (default)
    0 no header

  • Separator
    Any character that separates columns (typically comma, semicolon or tab)

  • Qualifier
    Any character used to encapsulate text, e.g. such that the text can contain characters that would otherwise separate it (typically single quote ' or double quote ")

  • NumberFormat
    , comma will be used as decimal separator (no 1000 separators are used in CSV)
    . period will be used as decimal separator (no 1000 separators are used in CSV)
    DateFormat
    d-M-yyyy

Shortcuts
In addition to the above complete specification, the following shortcuts are available instead of specifying Number and Date formats.
us set all above to what they typically are in the USA
da set all above to what they typically are in Denmark (like most of Europe)
Example: da or 0/da

@WriteFileIfInputIsEmpty

If the number of rows in the Data Source is zero, it is possible to control if the command should write a empty file or not. The value can be true or false and the default value is true. (Introduced from Perfion 2023 R1)

Map

No mapping can be done with this command. This Command is only meant to serve the final step of converting data to be saved in the output-format, to a File-path or send it to a Stream.
If you need to map data use one of the many other Commands such as e.g. SELECT or SELECT.UNIQUE before using this command.