On this page | |
Since | 17.5 |
This node allows a CSV file to be created from work item attributes and result data. Data queries can be added to specify which data from the work item should get written to the outputted CSV file.
Normally one row will be written for each work item in the upstream item. For example, if the node generates from a single upstream item, there will only be one row in the CSV file. If the node generates from a partition which contains 10 work items, the CSV file will contain 10 rows. Setting Multiple Values per Query to Add Rows may result in multiple rows being generated for a given item.
The opposite of this node (create work items from rows of a CSV file) is the CSV Input node.
Parameters ¶
Generate When
Determines when this node will generate work items. You should generally leave this set to “Automatic” unless you know the node requires a specific generation mode, or that the work items need to be generated dynamically.
All Upstream Items are Generated
This node will generate work items once all of the input nodes have generated their work items.
All Upstream Items are Cooked
This node will generate work items once all of the input nodes have cooked their work items.
Each Upstream Item is Cooked
This node will generate work items each time a work item in an input node is cooked.
Automatic
The generation mode is selected based on the generation mode of the input nodes. If any of the input nodes are generating work items when their inputs cook, this node will be set to Each Upstream Item is Cooked. Otherwise, it will be set to All Upstream Items are Generated.
File ¶
CSV File
Specifies the output path of the CSV file.
File Tag
Specifies the file tag for the result.
Format ¶
Quoting
Specifies how column values will be quoted. The CSV convention is that values can optionally be surrounded with quotes. Quoting is necessary if the value contains a quote, line separator or column separator character. However some software requires more or less quoting.
Minimal: Values will only be quoted if they contain quote, line separator or column separator characters.
Non Numeric: All non-numeric (string) values will be quoted. This is the default.
All: All values will be quoted.
None: No values will be quoted. However quotes, line separator and column separator characters will be escaped with a quote character.
Column Delimiter
When enabled, specify a character to use to delimit columns in the file. Typically this is a comma or tab character.
Write Header
Specifies whether the node should write a header to the CSV file. If this is enabled, a header row will be written to the CSV file where each header is the name of the attribute or the result data tag.
Data ¶
Attributes to Write
Selects how to specify the attributes to be written to the CSV file.
By Data Queries
Select this to specify work item attributes by the Data Queries multiparm. The order of the multiparm will be the order of the columns in the file.
By Column Attribute
Select this to specify an attribute from which to read the names of attributes to dump to CSV. The attribute should be a string array attribute which contains names of attributes on the workitems. The order of the names will be the order of the columns in the file.
By Attribute Pattern
Select this to specify work item attributes using an Attribute Pattern.
Missing Attribute
Determines how the node should handled missing attributes on work items.
None
Missing attributes are ignored
Report Error
Missing attributes cause the node to report an error, and fail to generate work items
Report Warning
Missing attributes cause the node to report a warning, and continue generating work items
When Multiple Values
If there are multiple values found for the given query, how they should be written. For example if the query is “file/geo”, there may be multiple results for a given item. Since
Add Rows
An extra row should be written for each value returned.
Add Columns
Each value will be written as a new column.
Column Attribute
When Attributes to Write is set to By Column Attribute, this parameter specifies the name of the work item attribute that contains the list of attributes to write to the CSV file.
Attribute Pattern
When Attributes to Write is set to By Attribute Pattern, this parameter species the Attribute Pattern used to determine which attributes are written to the CSV file.
Attribute Name / Tag
This parameter is the actual query that will be performed on the upstream item. It can be either an attribute name or a file tag.
The position of this parameter within the multi-parameter list determines the column that the data will be written to.
Examples ¶
WriteCSV Example for CSV Output TOP node
This example demonstrates how to create a csv file from pdg work item’s attributes.
See also |