# Tutorial: Copying From CSV to Excel and Emailing the File

> In this tutorial, we'll copy the data from a CSV file to an existing Excel file and then we'll attach the Excel file to an email and send the email from Outlook.

In this tutorial, we'll copy the data from a CSV file to an existing Excel file and then we'll attach the Excel file to an email and send the email from Outlook.

We will create a project and start by adding a [Use Excel File](https://docs.uipath.com/activities/docs/excel-application-card) activity to indicate the Excel file where we want to copy the data. Inside this activity, we will add a [Read CSV](https://docs.uipath.com/activities/docs/read-csv-file) activity to indicate the CSV file to copy from and where in the Excel file to copy to. We'll then add a [Use Desktop Outlook App](https://docs.uipath.com/activities/docs/outlook-application-card) activity to indicate the Outlook account to use and inside it we will add a [Send Email](https://docs.uipath.com/activities/docs/send-mail-x) activity to send the email.

1. Set up the project and get the necessary files.
   1. [Create a new blank project using the default settings](https://docs.uipath.com/studiox/standalone/2023.10/user-guide/creating-your-first-automation-project).
   2. Download and extract the archive with the automation project in this example using the button at the bottom of this page, then copy the files **A.csv** and **B.xlsx** to your project folder.
2. Add the Excel file to the project.
   1. Click **Add Activity** ![docs image](https://dev-assets.cms.uipath.com/assets/images/studiox/studiox-image-plus_sign-ad04beef-8e75b25b.png) in the Designer panel, and then find the **Use Excel File** activity in the search box at the top of the screen and select it. A **Use Excel File** activity is added to the Designer panel.
   2. In the activity:
      * Click **Browse** ![docs image](https://dev-assets.cms.uipath.com/assets/images/studiox/studiox-docs-image-browse_files-3f5ed0c5-1431ef7d.png) next to the **Excel file** field, and then browse to and select the file `B.xlsx`
      * In the field **Reference as**, enter `ExcelB`.

        You have indicated that you will work on the file B.xlsx that is known in your automation as ExcelB.
3. Add an activity to copy the data from the CSV file to the Excel file.
   1. Click **Add Activity** ![docs image](https://dev-assets.cms.uipath.com/assets/images/studiox/studiox-image-plus_sign-ad04beef-8e75b25b.png) inside the Use Excel File activity, and then find the **Read CSV** activity in the search box at the top of the screen and select it. The activity is added inside the Use Excel File activity.
   2. In the **Read CSV** activity:
      * Click **Browse** ![docs image](https://dev-assets.cms.uipath.com/assets/images/studiox/studiox-docs-image-browse_files-3f5ed0c5-1431ef7d.png) next to the **Read from file** field, and then browse to and select the file **A.csv**.
      * Click **Plus** ![](https://dev-assets.cms.uipath.com/assets/images/studiox/studiox-image-plus_menu-90e71eaa-8a20ac7d.png) on the right side of the **Output to** field, and then select **ExcelB** > **Indicate in Excel**. The spreadsheet is opened in Excel. Because there is already data in the file and we want to keep it, select the first cell in the first empty row (cell **A7**), and then click **Confirm**. The field is updated with your selection **[ExcelB] Sheet1!A7**.

        You have indicated that you want to copy the data from the CSV file A.csv to the file ExcelB in Sheet1 starting with the A7 cell.

        ![docs image](https://dev-assets.cms.uipath.com/assets/images/studiox/studiox-docs-image-350512-97fa5903-751cb36f.webp)
4. Add the Outlook account to the project and send the email.
   1. In the Activities panel, select the **Mail** tab and drag the **Use Desktop Outlook App** activity and drop it below the Use Excel File activity. A Use Desktop Outlook App activity is added to the Designer panel.
   2. In the activity, the default email account is already selected in the **Account** field. If you want to use a different account, select it from the drop-down menu.

      In the **Reference as** field, leave the default value `Outlook` as the name by which to refer to the account in the automation.
   3. In the Activities panel, drag the **Send Email** activity and drop it inside the Use Desktop Outlook App activity.
   4. In the Send Email activity:
      * Click **Plus** ![docs image](https://dev-assets.cms.uipath.com/assets/images/studiox/studiox-image-plus_menu-90e71eaa-8a20ac7d.png) on the right side of the **Account** field, and then select **Outlook**.
      * Click **Plus** ![docs image](https://dev-assets.cms.uipath.com/assets/images/studiox/studiox-image-plus_menu-90e71eaa-8a20ac7d.png) on the right side of the **To** field, and then select **Text**. In the Text Builder window, enter an email address where to send the email. For example, you can enter your own email address to send the email to yourself. If you leave the **Save as draft** option selected, the automation does not send the email, it instead saves the email to the Outlook Drafts folder.
      * Click **Plus** ![docs image](https://dev-assets.cms.uipath.com/assets/images/studiox/studiox-image-plus_menu-90e71eaa-8a20ac7d.png) on the right side of the **Subject** field, and then select **Text**. In the Text Builder window, enter a subject for the email, for example `Updated Excel File`.
      * Click **Plus** ![docs image](https://dev-assets.cms.uipath.com/assets/images/studiox/studiox-image-plus_menu-90e71eaa-8a20ac7d.png) on the right side of the **Body** field, and then select **Text**. In the Text Builder window, enter text for the body of the email, for example `See attachment`.
      * For Attachments, select **Files**, then click **Browse** ![](https://dev-assets.cms.uipath.com/assets/images/studiox/studiox-docs-image-browse_files-3f5ed0c5-1431ef7d.png) next to the field, and then browse to and select the file **B.xlsx**.

        ![docs image](https://dev-assets.cms.uipath.com/assets/images/studiox/studiox-docs-image-350516-90199605-2795ac8a.webp)
   5. Click **Save** in the StudioX ribbon to save the automation, then click **Run** to execute the automation.The data from A.csv is copied to B.xlsx, and then attached to a mail message and sent using the details configured in the Send Email activity. [Download example](https://documentationexamplerepo.blob.core.windows.net/examples/StudioX_V2022.10/ReadCSVMailXLSX.zip)
