|Note: This documentation refers to Gravio 3.8 or older. For Gravio 4 or newer, please refer to the respective documentation on doc.gravio.com .|
The WriteCSVFile action component writes a CSV file from the received data.
This example shows how to use the ReadCSV action component to get some data, and then write that into a CSV using the WriteCSVFile action component.
Once the ReadCSV action component has read the headers of the CSV, you select the WriteCSV action component and click on the
icon to automatically fill the step result fields.
sin @prefix stands for “Step In”.
Once you have set the fields, go to Properties and define a file name to save the file to your local HubKit.
If you check “Overwrite”, the file will be overwritten even if it already exists. If unchecked, if there is an existing file, an error will occur and the action will be stopped.
If you check “Output header”, the header specified in “Header row label name list” will be included in the CSV.
“Header row label name list” specifies header items when outputting headers, separated by a comma.
In “Output field name list”, specify the fields to be outputted as data, separated by commas. If a nonexistent field is specified, an error occurs and the action execution is stopped.
- The fields that can be specified are those displayed in “In Fields”.
The file is saved in the local Gravio HubKit
<Gravio data folder>/action/data folder whereby the
<Gravio data folder> is either:
On Mac OS:
The character code is UTF-8.
The corresponding part of this action component is the ReadLocalFile component.
A typical setup would be to read the data from the local sensor database using the
ReadUserDB component and then write the data into a CSV for further processing. This could look like this: