Get table from CSV Version 7 (Net)
Action group: Tables
Description
This action is designed to read a table from the CSV format.
Action icon
Settings of parameters
Property | Description | Type | Filling example | Mandatory field |
Parameters | ||||
File | Path to the CSV file. | Robin.FilePath | Yes | |
Encoding | Source file encoding. | Robin.String | Yes | |
Line separator | Line separator in the source file. Default is rn | Robin.String | No | |
Column separator | Character used to separate the columns in the source file. The default is «;» | Robin.String | No | |
Heading | If the value is «true», the table header will be inserted into the document along with its rows. | Robin.Boolean | true | No |
Remove duplicate header | If the value is «true», indexes will be added to the same column names in the header of the resulting table. Numbering starts from 1. | Robin.Boolean | true | No |
Results | ||||
Result | The resulting table. | Robin.DataTable |
Special conditions of use
For the "Heading" parameter:
When "true", the action will keep the first row of the original table in the header of the returned tabular value, i.e. it will not be the row with the table contents.
When "false", the first row will leave the first row in the table content part and the default names will be used in the header - 1, 2, 3, etc.
For the "Remove duplicate header" checkbox:
When "true", indexes will be added to identical column names in the header of the tabular value that actions return as a result. The numbering starts from 1.
If the value is "false", the column names will remain the same. Actions on net that return/process such tables with duplicated column names will crash with an error, because net cannot have a header with identical column names.
Example of a table in CSV format:
Example of use
Task
There is a table in CSV format. You need to get it into a variable of type "Table".
Solution
Use "Get table from CSV".
Implementation
- Move the "Get table from CSV" action to the workspace:
- Set the parameters for this action:
3. Start the robot using the "Start" button in the top panel.
Result
The program robot completed successfully.
The table from CSV is retrieved.
Additionally: the result of action processing when the "Heading" checkbox is checked.