# Write CSV

> `UiPath.CSV.Activities.AppendWrite.CsvFile`

`UiPath.CSV.Activities.AppendWrite.CsvFile`

## Description

Copies saved for later table data or data from an Excel file, Excel range, table, or sheet, and pastes it after the existing data in a specified CSV file. The copied data replaces any data that already exists in the CSV file. If the CSV file does not exist, it is created when the automation is executed.

## Project compatibility

Windows - Legacy | Windows | Cross-platform

## Cross-platform configuration

#### In the body of the activity

* **Resource CSV file** - Select Plus on the right side of the field to toggle between using a local path or a Resource file (of type CSV). We recommend using relative folder paths to accommodate the file structure variations between Windows and Linux during project execution. For example, `newFolder` or `otherFolder`.
* **What to write** - Select an Excel file and use the available options to choose a table, a sheet, or indicate a range in Excel.
* **How to write** - From the dropdown menu, choose one of the following options:
  + **Write** - Copies and pastes to the specified CSV file saved for later table data or data from an Excel file, Excel range, table, or sheet.
  + **Append** - Append to the end of the file; headers are excluded. Select a parent Excel file, and then a named range, table, or sheet, or indicate a range in Excel. If the activity is inside an Excel **For Each Row** activity, you can select **CurrentRow** to copy data from the current row in the iteration.
* **Include headers** - If enabled, the column headers are copied to the CSV file.

**Properties**

Options

* **Delimiter** - Select the delimiter used in the CSV file: **Tab**, **Comma**(','), **Semicolon**(';'), **Caret**('^'), or **Pipe**('|').
* **Encoding** - Select the encoding type to be used. You can find the complete list of codes for each character encoding [here](https://docs.uipath.com/activities/other/latest/productivity/supported-character-encoding#supported-character-encoding). If no encoding type is specified, the activity searches for the file's Byte Order Marks to detect the encoding. If no Byte Order Marks are detected, the system ANSI code page is selected by default.

## Windows-Legacy, Windows configuration

For more details on the configuration, check the [Write CSV](https://docs.uipath.com/activities/other/latest/productivity/write-csv-file) activity, under classic activities.

## Examples of Using the Write CSV Activity

* You can download a sample automation project that, among others, includes a **Write CSV** activity [here](https://docs.uipath.com/activities/other/latest/productivity/filter-csv-files).
* To learn how to use this activity in a StudioX project, see [Tutorial: Comparing Excel Files and Emailing Reconciliation Errors](https://docs.uipath.com/studiox/docs/tutorial-comparing-excel-files-and-emailing-reconciliation-errors).
