|
File System - CSV to dataset |
Declaration
<AMFILESYSTEM ACTIVITY="csv_to_dataset" SOURCE="text" RESULTDATASET="text" ROWASHEADER="YES/NO" DELIMITER="text (options)" />
Description
Reads data from a comma-separated values (CSV) file (although the separator character does not necessarily have to be a comma) and populates a dataset with results.
Practical Usage
Used to automate the movement of tabular data between programs that natively operate on incompatible (often proprietary) formats. For example, a user may need to transfer information from a database program that stores data in a proprietary format, to a spreadsheet that uses a completely different format. The database program most likely can export its data as "CSV". Automate can then read the exported CSV onto a dataset and eventually import the dataset values onto the spreadsheet program.
- (") double quotes
- (/) backslash
Parameters
General
Property | Type | Required | Default | Markup | Description |
---|---|---|---|---|---|
Source | Text | Yes | (Empty) |
|
The
path and file name of the .csv file to read data from. NOTE: Files with invalid paths are ignored at runtime. |
Create and populate dataset | Text | No | (Empty) | RESULTDATASET="DatasetName" | The name of a dataset to create and populate with information pertaining to the source .csv file. More about the individual dataset fields that this activity creates can be found below under Datasets. |
Advanced
Property | Type | Required | Default | Markup | Description |
---|---|---|---|---|---|
Treat first line of data as column headers | Yes/No | No | No | ROWASHEADER="YES/NO" | If selected, Automate will treat the first line of CSV data as column headers. If disabled, column headers are ignored. |
Delimiter | Text (options) | No | (Empty) |
|
The
character used to separate the tabular values in a CSV file. The
available options are:
|
Example
- The sample AML code below can be copied and pasted directly into the Steps Panel of the Task Builder.
- Parameters containing user credentials, files, file paths, and/or other information specific to the task must be customized before the sample code can run successfully.
Description
This sample task saves a CSV file into a dataset.
<AMFILESYSTEM ACTIVITY="csv_to_dataset" SOURCE="C:\temp\comma-delimited.csv" RESULTDATASET="reportData" />