Description
The DelimitedFileV2Receiver writes Domain Attribute values in a delimited format to a file.
Parameters
The following parameters can be defined for the DelimitedFileV2Receiver. Items with an asterisk (*) are required.
- path* - Defines the location to store the newly generated delimited output file.
- subDir - Defines the sub-directory location to store the newly generated delimited output file.
- fileName* - Defines the name of the output file.
- uniqueAttribute - Defines a Domain Attribute the Receiver will use to identify a unique value that has already been inserted into the file and prevents it from being inserted twice.
- delimiter* - Defines the character used as the column delimiter.
- headerFilePath - Defines the path of the XML configuration file that has header information.
- headerFileName - Defines the file name of the XML configuration file that has header information.
- quoteTextData* - Defines the character to use when quoting text data.
- booleanValue* - Format a Boolean Object with the selected mask.
- nullValue* - Represents a Null value.
- includeHeader* - Defines whether to include the header within the delimited file or not.
- appendToFile* - Determines whether the file will open in append mode. If true, rows will be appended to the file; otherwise, the file will be overwritten.
Receiver Attribute Property Keys
The Receiver defines three property keys that can be modified on any of its associated Domain Attributes:
- columnName - Defines the column name as it will be output in the delimited file header.
- include - Determines if the Attribute will be included as a column in the output.
- useQuotes - Determines if a value should be quoted. Sometimes a numeric value should be quoted (e.g. SSN).
Using Multiple Header Configuration File
The DelimitedFileV2Receiver has two optional parameters that allow it to read from an XML configuration file that defines one or more header rows for the delimited file output.
When these two parameters are left empty, the DelimitedFileV2Receiver will automatically use each Attribute's originalName parameter to define a one-row header in the delimited file output.
- headerFilePath - Defines the path to an XML configuration file that has header information.
- headerFileName - Defines the file name of XML configuration file that has header information.
Delimiter
This Receiver allows for three delimiter types:
- Tab - \t
- Pipe - |
- Comma - ,
The Tab delimiter is the default delimiter.
QuoteTextData
This Receiver allows for three quoteTextData types:
- None - text
- Single - 'text'
- Double - "text"
Example Stories
The example stories below, show different use cases where the DelimitedFileV2Receiver is used to write Domain Attributes to a delimited file. In some cases, the parameters or property key values determine the behavior of the Receiver and how or if this data is written to the generated delimited file.
Domain
The example outputs are based on following Domain defined below:
Story 1: Using Quoted Values in Your Delimited File
One or more Attribute values can be quoted with single or double quotes when generating a delimited file. To do so, you will first need to select an option for the quoteTextData parameter. For this example, Double has been chosen.
Next, click on the Attributes Property Keys tab to configure what Attributes will use quotes.
Click on an Attribute to select it and view its property key configuration. Set the useQuotes parameter key to true and click Save to finish.
Please note that this step will need to be performed for each Attribute value that will use quotes. The Attribute Parameter Keys configuration will appear as shown below for this example.
Sample Output
For this example, three Attribute values use quotes: firstName, lastName, and userName.
Story 2 - Example Single-Row Header Without Configuration File
This example shows the configuration and sample output for a Tab delimited file without an XML configuration file. In this example, the value of each Attribute's originalName is used to define the single row header.
Parameter Configuration
The configuration will appear similar to what is shown below:
Sample Output - Single-Row Header without Configuration File
The following is the sample output file using the Domain and Parameter configuration show above.:
Story 3 - Example Multi-Row Header with Configuration File
This example shows a Tab delimited file example with an XML configuration file that defines a three-row header for each of the User Domain columns.
Parameter Configuration
To use an XML configuration file, you will need to enter values for these two parameters:
- headerFilePath
- headerFileName
Example Configuration File
The following is an example XML configuration file that defines a three-row header for each of the User Domain columns:
<headers>
<attribute name='id'>
<column></column>
<column></column>
<column>ID</column>
</attribute>
<attribute name='firstName'>
<column></column>
<column>First</column>
<column>Name</column>
</attribute>
<attribute name='lastName'>
<column></column>
<column>Last</column>
<column>Name</column>
</attribute>
<attribute name='emailAddress'>
<column>User </column>
<column>Email</column>
<column>Address</column>
</attribute>
<attribute name='username'>
<column></column>
<column></column>
<column>username</column>
</attribute>
<attribute name='password'>
<column></column>
<column></column>
<column>password</column>
</attribute>
</headers>
Sample Output - Multi-Row Header With Configuration File
The following is an example output of a Tab delimited file with the XML configuration file defined above: