Merge TSV Files
Combine several TSVs into one, vertically. The reason not to use cat: the header row would repeat in the middle of the file, and if the files' columns differ at all the result is silently misaligned. This matches columns by name across the files, takes the union as the output header, and fills in empties where a file didn't have a column — so an export whose schema drifted between runs still merges correctly.
How to use
- Paste or drop up to three files, one per box. Each needs its own header row.
- Check the output header — it's the union of all the inputs' columns, in first-seen order.
- Read the row count in the status line and confirm it's the sum you expected.
- Copy or download the merged file.
Merge is not join
This stacks files on top of each other, making the table longer — the right operation when the files have the same kind of rows from different periods, regions, or sources. Join combines files side by side by matching a key, making the table wider. If you're trying to attach extra fields to existing rows, you want join; if you're trying to pool rows, you want this page.
Columns are matched by header text, exactly. user_id and userid are two different columns and you'll get both, half-empty — a strong signal to normalise the headers first with header tools.
Duplicates and provenance
Merging can create duplicate rows if the inputs overlap; dedupe afterwards, on a key subset rather than whole rows if the copies differ in a timestamp column. And once merged you can no longer tell which file a row came from — if that matters, add a constant column to each input first with append column (source = jan, source = feb) and merge after.
FAQ
Can I merge more than three files?
Merge three, then paste the result back into the first box and merge the next batch. There's no limit that way, and each pass shows you the row count so you can keep track.
What if the column order differs between files?
It doesn't matter — columns are matched by name, not position, and the output uses the union in first-seen order.
What if a file has no header?
Add one first with header tools; without names there's nothing to match on, and the first data row would be treated as the header.
What's the shell equivalent?
(head -1 a.tsv; tail -q -n +2 *.tsv) > all.tsv — but only correct when every file has identical columns in identical order. That's the assumption this page removes.
Privacy
100% client-side. No upload. See the privacy policy.