Combine many CSV files into one sheet
All files from a folder in one table, with the columns lined up and the source file on each row.
- You start it: When you start it
What it does
The task
Open the folder folder url, and read each CSV and Excel file in it. Match the columns by name, also when the names differ a little, such as Date and Order date. Put all rows in a new Google Sheet with a Source file column, and keep the original values. Add a tab named Mapping with the column mapping. Report the number of rows from each file, the columns that only some files have, and the files that you could not read.
- It works in Google Drive, Google Sheets and Dropbox, in the workspace you pick, and signs in with passwords from your Cuiar vault.
- It runs once, when you start it.
What you give it
| Blank | What to give | Example |
|---|---|---|
| folder url | The folder with the files | https://drive.google.com/drive/folders/1Cb6tFz9Wq |
What you get back
An example run with the example values above. Your run uses your own data.
Files read: 36 of 37 (orders-2024-07.xlsx has a password)
Rows combined: 58,214
Mapping: 'Order date', 'Date' and 'order_dt' to Order date; 'Total (EUR)' and 'Amount' to Total
Columns in only some files: Discount code (files from 2025), Channel (12 files)
Rows for each file: 1,204 to 2,091
Sheet: Orders combined, tabs Data and Mapping
Run it in Cuiar
- 01
Open it
Click Use in Cuiar on this page. The side panel opens with the task in the composer.
- 02
Fill in the blank
Type folder url. Tab moves to the next blank.
- 03
Run it
Run sends it to the agent. Follow each step in the panel, and stop it at any time.
From the terminal
cuiar exec "Open the folder https://drive.google.com/drive/folders/1Cb6tFz9Wq, and read each CSV and Excel file in it. Match the columns by name, also when the names differ a little, such as Date and Order date. Put all rows in a new Google Sheet with a Source file column, and keep the original values. Add a tab named Mapping with the column mapping. Report the number of rows from each file, the columns that only some files have, and the files that you could not read."Run it from your AI agent
Claude Code, Codex, Cursor and other MCP clients reach Cuiar at https://mcp.cuiar.com/mcp. Add the server one time, then ask for the task in plain words, or call run_task yourself.
1. Add Cuiar to Claude Code
claude mcp add --transport http cuiar https://mcp.cuiar.com/mcp2. Ask your agent
Use the Cuiar tool run_task to run my "Combine many CSV files into one sheet" template with folder url = https://drive.google.com/drive/folders/1Cb6tFz9Wq.Setup for other agents: AI agents.
The tool call
{
"name": "run_task",
"arguments": {
"task": "Open the folder https://drive.google.com/drive/folders/1Cb6tFz9Wq, and read each CSV and Excel file in it. Match the columns by name, also when the names differ a little, such as Date and Order date. Put all rows in a new Google Sheet with a Source file column, and keep the original values. Add a tab named Mapping with the column mapping. Report the number of rows from each file, the columns that only some files have, and the files that you could not read."
}
}Related templates
All data templatesData
Pull tables from PDFs into a spreadsheet
Each matching table from your PDFs and scans in one sheet, with numbers as numbers and the page noted.
You start it: When you start it- Google Drive
- Google Sheets
Sales
Answer an RFP or a security questionnaire
A draft answer for each question from your own documents, with the source and the gaps marked.
You start it: When you start it- Google Sheets
- Confluence
- Google Drive
Ops
List renewal dates from your vendor contracts
End date, notice period and auto-renewal of each contract in a sheet, the next deadline first.
You start it: When you start it- Google Drive
- DDocuSign
- Google Sheets
OpsAsks first
Find files shared publicly from your Google Drive
Every file that anyone with the link can open, with its owner and last edit. Access changes after you approve.
You start it: When you start it- Google Drive
- Google Sheets
OpsAsks first
Sort and rename files in a shared folder
Each file renamed and moved by your rules, with a list of every change. Nothing moves before you approve.
You start it: When you start it- Google Drive
- Dropbox
Finance
Find card payments that have no receipt
Each card payment matched to a receipt from your inbox or folder, with the missing ones listed first.
You start it: When you start it- Any bank site
- Gmail
- Google Drive
- +1 more: Google Sheets