A customer recently asked for an example of merging multiple CSV files into a single CSV file. Initially, we considered recommending the Encodian ‘Flowr‘ action ‘Excel – Merge Files‘; however, this action focuses on merging the structure and content of files, thus producing multiple worksheets.
Therefore, we proposed the Encodian ‘Excel – Merge Rows‘ action. This action allows the concatenation of content from multiple Excel or CSV files into a single file and worksheet. It also provides the option to control header-row merging, which was necessary for this use case as the output CSV needed only the header row from the first CSV.
This post will demonstrate how to merge two CSV files with the output sent via email.
To test this flow, you will need some CSV files. Feel free to use these example files:
1.a. Flow name: Provide a name for your flow
1.b. Trigger: Select the ‘Manually trigger a flow‘ trigger action
1.c. Click ‘Create‘
2.a. Click ‘Add an input‘ > Select ‘File‘ > Enter the name ‘CSV File 1’
2.b. Repeat step 2.a. with the name ‘CSV File 2’
3.a. Filename: File.csv and Output Format: CSV
3.b. Documents > Add New Item
3.c. Documents > Add New Item
3.d. Preserve First Row: True
The two CSV files have now been processed by the Encodian action. For this example, we will email a copy of the output CSV containing the merged CSV file to the user who triggered the flow.
NOTE: At the time of writing, there is a bug (well, several!) with the new Power Automate UI, where the ‘User email‘ property provided by the ‘Manually trigger a flow‘ trigger action is provided to the action encoded as a base64 string. Use the bae64ToString() expression to decode the value if required.
The flow is now complete, so it can be tested using the example CSV files provided (or any two different CSV files).
Following the execution of the flow, an email will be received with the merged CSV file as an attachment.
Open the attachment to see the merged data.
We hope this post provides a helpful guide to merging CSV files using Power Automate and the Encodian ‘Flowr‘ connector. If you require further assistance, please review the documentation on our support portal or raise a ticket with our support team.
Please share any feedback or comments – all are welcome.
Save time with 200+ actions across 9 connectors
Sign up for your free 30-day trial; no cards, catches, or contracts.
Don’t struggle! Try out our Premium Support packages today.
Operations Director