Table to CSV Version 21 (Net)
Action group: Tables
Description
The action saves tables in the CSV format
Action icon
Settings
Property | Description | Type | Filling example | Mandatory field |
---|---|---|---|---|
Parameters | ||||
Data table | Table for which the action will be performed. | Robin.DataTable | Yes | |
Encoding | Encoding of the resulting file. UTF-8 is default. | Robin.String | No | |
Line separator | The character used to separate the lines. Default is rn | Robin.String | No | |
Column separator | Character used to separate the columns in the source file. The default is «;». | Robin.String | No | |
File name | Name of the file (without extension) to be created. The extension .csv will be added automatically by the action. | Robin.String | Yes | |
Folder | Folder path where the created file will be saved. | Robin.FolderPath | C:\doc\img | Yes |
Heading | If true, the table header will be inserted into the document along with its rows. | Robin.Boolean | true | No |
Results | ||||
Result | Path to the created CSV file. | Robin.FilePath |
Special conditions of use
For a "With Header" parameter:
- When “true”, the action will write the header row of the source table into the document as the first row along with the rest of the main rows of the table. Example: the Studio specifies that the table “Columns: 3; rows: 2”, when pasted into the document, 3 columns and 3 rows will be filled in.
- If “false”, the action will only write to the document the main rows with the contents of the source table. Example: the Studio specifies that the table “Columns: 3; rows: 2”, when inserted into the document, 3 columns and 2 rows will be filled.
Example of use
Task:
You have an Excel file with the table
Save it in the CSV format with the heading to the workspace.
Solution
Use the "Open", "Get table", "Table to CSV" actions.
Implementation
- Assemble a robot scheme with the actions:
- Set the "Open" action parameters.
- Set the "Get table" action parameters.
- Set the "Table to CSV" action parameters:
In the “Table” field, specify a variable of the “Table” type with data.
In the "Encoding" field specify a UTF-8 value.
In the “Line Separator” field, enter \r\n.
In the "Line separate" field enter ;
In the "File name" enter "New".
In the "Folder" field set the path to the new CSV file.
In the "Heading" check the box = true.
In the "Result" field set the "Path to file" variable type that will have the path to the new file.
Result
The program robot completed successfully.
The table is saved in CSV. The file is located at the specified path.
Optional: if the “Heading” checkbox is not checked in the “Table to CSV” action, the table will be saved without a heading.
Обзор
Инструменты контента