Combine CSV files without repeating headers

Merge CSV exports into one table while keeping a single header row and checking column names, missing values and duplicate records.

Last updated

Pasting one CSV underneath another often leaves a second header row in the middle of the data. It can also put values in the wrong columns when the exports use a different order. A safe merge aligns fields first then appends the records under one header.

Inspect the first row of each export

Open a small sample from each file and compare the headings. “Email” and “Email address” may mean the same thing to you but they’re different labels. Decide which names you want before combining the files.

Don’t assume two columns mean the same thing just because their names match. An “Amount” field could contain different currencies or represent a gross total in one export and a net total in another. The merger can’t infer that distinction from the heading alone.

Use the preview to verify alignment

Open Merge CSV and add the files. The tool matches columns by their heading. It also reports differences between the source files so you can inspect extra or missing columns.

For example one file might use “Name, Email, City” while another uses “City, Name, Email”. The output should place each person’s city under City even though its position changed. Check one recognisable record from every input rather than only the first output row.

If an export contains an extra field then decide whether keeping it helps. Empty cells for sources that don’t supply that field can be correct. They aren’t automatically evidence that the merge lost data.

Keep track of where records came from

Enable the source-file column if you need to trace rows back to an export. This is helpful when two departments provide similar records or a value needs checking later.

Keep source filenames meaningful before starting. Names such as “north-september.csv” and “south-september.csv” explain more than two files both called “download.csv”. The source column records a filename rather than proving anything about where the data originally came from.

Handle duplicate records separately

Start with duplicate removal off. Check the total row count against the number of data rows in the inputs. Remember that each source header isn’t a data record and the final output needs only one header.

If identical records shouldn’t repeat then inspect what enabling duplicate removal changes. A repeated purchase or event might be legitimate. Removing an exact duplicate can still discard a real occurrence if the export doesn’t include a unique identifier.

Clean CSV is useful for a separate cleanup pass. Don’t combine several cleanup decisions without inspecting their effect because it’s harder to explain why a row disappeared.

Reopen the exported file

Download the merge and check its first rows plus a record from near each source boundary. Confirm that only one header is present. Look at identifiers with leading zeros before opening the result in a spreadsheet that might reinterpret them.

Keep the originals until you’ve checked the destination import. A preview proves the merge’s shape but the receiving application may still apply its own rules.

Common questions

Do the columns need to be in the same order?

Utility Mule matches columns by their headings rather than their original positions. Review the merged preview because equivalent ideas with different labels still need deliberate alignment.

Does removing repeated headers remove duplicate records?

No. Headers describe columns while duplicate records are repeated data rows. Review those separately and only enable duplicate removal when identical rows are actually unwanted.

Can I merge files with no header row?

This merger treats the first row as headings. Add meaningful headers to a working copy before using it or the first data record may be interpreted as column names.

Tools for this

More guides