--- title: "Merging CSV Files into an Excel File" slug: "merging-csv-files-into-an-excel-file" updated: 2023-05-29T10:09:01Z published: 2023-05-29T10:09:15Z canonical: "documentation.decisions.com/merging-csv-files-into-an-excel-file" --- > ## Documentation Index > Fetch the complete documentation index at: https://documentation.decisions.com/llms.txt > Use this file to discover all available pages before exploring further. # Merging CSV Files into an Excel File Example Lab ArticleWhile Example Lab projects are resources for public use, articles and assets are not actively maintained. Screenshots and features are from the specified version below. These references may become dated as new versions are released. --- ## Overview | ## Example Lab Details | | --- | | **Version** | 6.18.0 | | **Root Folder** | Example Lab - Merging CSV Files into an Excel File | | **Modules** | None | | **Dependencies** | None | This Example Lab demonstrates how to merge CSV files into a single Excel file by saving them into different worksheets and how to download the Excel file in a Form. --- ## Explanation The **Create New Excel File** step creates the Excel file for saving the CSV files' data. This project requires the user to input CSV files to the Parent Flow labeled **"CSVFiles"** at the start step of this example Flow. Example CSVs are included within the Project Download. The **ForEach** step accepts "CSVFiles" as its input, so it loops given the number of CSV files uploaded by the user. Each loop passes the file into the provided **"Merge CSV"** Flow which transfers the data from each file row by row into the created Excel file. Within this Flow, the **Create Data** and **Add** steps create a counter differentiating one row from another. The **Add Work Sheet** step creates a worksheet in the Excel file to save this CSV's data. The Flow then begins to gather the data row by row due to the **For Each Excel or CSV** step, while the **Set Values in Row** step maps each CSV row's data into its own Excel row. This example maps only two columns of data for each row, but if a user wishes to transfer more columns of data, then select the Set Values in the Row step, locate **"New Values"** under Inputs, and then click Add. A new item will appear below. Change that item's input mapping to Select From Flow, then map it to the next appropriate field in the current row. For example, **"Current Row.Field03.TextValue"** reads the CSV's third column of data, etc. Once this loop finishes, the **Update File with Data** step saves all the data taken from the CSV into the Excel file. Finally, the end step outputs the result of the Update File with Data step for the Form located in the Parent Flow. The generated Excel file may be downloaded from this Form. Reference Articles[Using For Each Excel Or CSV Row Step](https://documentation.decisions.com/docs/using-excel-csv-row-step) [Converting CSV to an Excel File](https://documentation.decisions.com/docs/converting-csv-to-an-excel-file) ![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/image-1685354561698.png) ![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/image-1685353730196.png) --- ## Project Download The examples attached were developed to be instructional and were not developed as officially supported components. For more information or to engage our service team to develop fully supported, production-quality solutions, please contact services@decisions.com. Import the project below to a Decisions environment on version 6.10.2 or later using our [Importing/Exporting](https://documentation.decisions.com/docs/exporting-and-importing-overview) article. [ExampleLab[Merge_CSV_Flow].zip](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/ExampleLab%5BMerge_CSV_Flow%5D.zip) ---