activities
latest
false
UiPath logo, featuring letters U and I in white
Productivity Activities
Last updated Nov 15, 2024

Manage CSV Files

By using this workflow, you can automatically read a .csv file and also append data from one .csv file to another .csv file.

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.

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.

    Note: Add your .csv files to the project directory in order to be able to run the entire process from the same place.
  3. 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.
  4. 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.
  5. Run the process. Data from file A is read and appended to file B.

Was this page helpful?

Get The Help You Need
Learning RPA - Automation Courses
UiPath Community Forum
Uipath Logo White
Trust and Security
© 2005-2024 UiPath. All rights reserved.