New to AI? Start here → Start 1. ChatGPT vs. Codex: what's the difference?

Last checked: November 10, 2026

Build an automation that merges CSV files

In one line

Build an automation that merges several CSV files
From copied practice files to a results file with totals that add up.

The big picture

Illustration (may look a little different from the real screen)

The October and November sales tables in input, and the results file saved to output
Click the picture to see it larger.

Follow along

Keep the downloaded practice files separate

Read before starting. The two CSV files below are made-up sales data with the same column names.

October practice CSV November practice CSV

Make a new practice folder called csv-practice, with an input folder and an output folder inside. Put the two downloaded files only in input.

Give Codex the processing rules

1. Choose csv-practice as the working folder

Choose the new folder, not the earlier reading-log project. Copy the prompt below, and first have it explain the setup it needs and its plan.

2. Ask it to build the program and explain how to run it

After checking the plan, ask it to build the program. If something extra needs installing, find out why first. If Codex can run things in your setup, have it run on the practice files. If you need to run it yourself, get exact steps for your computer.

3. Check the results in output

Don’t let it search through every file. Set it to read only the CSV files in input. If the output from an earlier run gets included as input, the totals can double.

Check it with small data where you know the answer

October has $120 and $180, and November has $150 and $250. You should get 4 input rows, $300 for October, $400 for November, and $700 in total.

Illustration (may look a little different from the real screen)

The four source sales cells next to the monthly totals table, confirming a $700 grand total
Click the picture to see it larger.

Even identical rows aren’t deleted automatically if there’s no transaction ID. If an amount isn’t a number or a required column is missing, it should report an error instead of quietly making a result.

Prompts you can copy

Ask for a CSV merge program

I want a program that merges only the two CSV files in the input folder of this practice folder. The required columns are Month, Item, and Sales, and amounts are in US dollars. Don't change the originals. Save the results in output. Don't delete duplicate rows on your own, and report missing required columns or invalid amounts as errors. Let me check the number of input rows, the merged result, the monthly totals, and the grand total. Make sure output is never read as input on the next run. Suggest a way without outside APIs first, and start by explaining the setup and your plan.

Test with the sample and check a re-run

Test the program you made with the practice files. Expected: 4 input rows, October $300, November $400, total $700. Also check that the originals stay the same, and that re-reading the results doesn't increase the totals. Also check what happens with an empty file, a missing column, and an amount that isn't a number. If you couldn't run it yourself, don't say you did. Tell me the steps to check it.

Where people get stuck

Lots of people get stuck here. Find the one that matches your situation!

Quick check: On the second run, the total became $1,400. What should I look at first?

Answer: “Check whether it read the old output as input”
If earlier results are read as input again, they can be counted twice. First check what’s included in input and output.

Official sources

Next tip

Turn repeated requests into a skill →

I'm stuck here

Stuck while following along? Tell me where. Only the site owner sees this. Leave your email only if you'd like a reply.