February 05, 2026

Merge CSV/XLSX files and align mismatched headers

How to merge multiple spreadsheets even when the columns don’t match, by aligning on column names.

By Oriah Editorial Team • 2 min read • 261 words

Merging files becomes tricky when different sources don’t share the same headers:

  • One file has Email, another has email_address
  • Columns appear in different orders
  • Some columns exist only in certain files

The safest approach is to align by column name and fill missing cells with empty values.

Step-by-step strategy

1) Normalize column names

If you control the upstream export, keep a consistent naming convention:

  • Use a single case: snake_case or Title Case
  • Avoid trailing spaces
  • Avoid duplicated headers

If you don’t control upstream files, do a quick pass to rename columns before merging.

2) Build a “master” header list

When merging multiple files, create the union of all headers:

  • Start with the first file’s header
  • Add any new columns found in the next files
  • Keep ordering stable (don’t shuffle columns every time)

3) Re-map each row into the master header

For every row, create an output record where:

  • Each master header has a value (or empty string)
  • Missing columns become empty
  • Extra columns are preserved

This prevents “column drifting” when you import the merged file into other tools.

Oriah Sheet behavior

Oriah Sheet merges CSV and XLSX inputs and:

  • Aligns by column name
  • Fills missing values with empty strings
  • Lets you export as CSV (choose delimiter) and/or XLSX

Common pitfalls to avoid

  • Duplicate header names: name appearing twice causes ambiguity.
  • Whitespace issues: Email vs Email are different columns.
  • Mixed encodings: one CSV might be UTF‑8, another Windows‑1252.

If you suspect encoding issues, re-export as UTF‑8 when possible.

Cookies & ads

We use cookies and similar technologies to improve the experience and display ads. Learn more.