Read from CSV
AutomatR.DefaultActivities.CSV.ReadCSV
The "Read from CSV" activity in AutomatR is part of the CSV activities package, facilitating the extraction of data from a specified CSV file for use in automation workflows. This activity offers flexibility by allowing users to include or exclude headers, define the delimiter, skip a specified number of rows, and save the extracted data into a DataTable variable for further processing.
Properties
Name | Description |
---|---|
Input | |
Delimiter | Specifies the delimiter used in the CSV file (e.g., Tab, Comma(,), Semicolon(;), Caret(^), or Pipe(I)). Char variables containing the desired delimiter. |
File Path | Specifies the full path of the CSV file on the local drive, including the filename (e.g., "C:\excelActivities\workbook.csv"). String variables containing the file path. |
Include Headers | When enabled, considers the first row of the CSV file as column headers during the read operation. Boolean variables to determine whether to include headers. |
Skip Number Of Rows | Specifies the number of rows to skip from the beginning of the CSV file. Integer variables containing the number of rows to skip. |
Misc | |
Display Name | Provides a customizable name for the activity displayed in the workflow. The display name enhances clarity and organization within the automation project. String variables containing the desired display name. |
Optional | |
Delay | Specifies the amount of time (in seconds) to wait before executing the "Read from CSV" activity. This can be useful for handling synchronization issues. Integer variables containing the delay duration. Ex.: If the amount of time is 1000 milliseconds or 1 sec, i.e., 1. |
Result | |
Result | Stores the data extracted from the CSV file in a DataTable variable for use in subsequent workflow activities. DataTable variables to store the extracted data. |
How to use:
- Drag and drop the "Read from CSV" activity onto the workflow.
- Configure the properties by specifying the delimiter, file path, and other optional settings.
- Optionally, configure the delay.
- Execute the workflow to read data from the specified CSV file.
Example: Consider an example where the "Read from CSV" activity is used to extract data from a CSV file:
Read from CSV:
File Path: "C:\example\data.csv"
Include Headers: True
Delimiter: ','
Skip Number Of Rows: 2
Result: extractedData
In this example, the activity reads data from the "data.csv" file located at "C:\example\". It includes headers, uses a comma as the delimiter, skips the first two rows, and stores the extracted data in the DataTable variable "extractedData" for further processing in the workflow.