UiPath Activities Guide

Manage CSV files

This example illustrates how to create an automation process that uses the Read CSV and Append To CSV activities. You can find these activities in the UiPath.Excel.Activities package.
By using this workflow, you can automatically read a .csv file and also append data from one .csv file to another .csv file.

To exemplify how to use these activities, we have created a sequence that includes a Read CSV and an Append To CSV activity.

This is how the automation process can be built:

  1. Open Studio and create a new Process.
  2. Drag a Sequence from the Activities panel to the Workflow Designer.

Important!

Add your .csv files to the project directory in order to be able to run the entire process from the same place.

  1. Drag a Read CSV from the Activities panel in the previously created Sequence.
    • In the Properties panel, add the full path of the file you want to read the data from to the FilePath property. In this case you can write as a path Environment.CurrentDirectory + "\A.csv".
    • Select the IncludeColumnNames check box. This way, when running the process, the first row in the .csv file will be considered to contain the column names.
    • Create a new DataTable variable called DT.
    • In the Properties panel, add the newly created variable to the DataTable property field.
  2. Drag an Append To CSV activity from the Activities Panel and place it below the Read CSV activity.
    • In the Properties panel, add the full path of the file you want to read the data from to the FilePath property. In this case you can write as a path Environment.CurrentDirectory + "\B.csv".
    • In the Properties panel, add the DT variable to the DataTable property field.
  3. Run the process. Data from file A is read and appended to file B.

 
 
Download example


Manage CSV files


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.