Combine TSV Columns
Join two or more columns into one. The everyday uses are building a composite key so you can join or dedupe on a single field, turning first_name and last_name into a display name, and assembling an address from its parts. The new column is appended, and you choose whether the sources stay or go. The inverse is split a column.
How to use
- Paste or drop the file and list at least two columns, in the order you want them joined.
- Set the separator. A space for names,
,for addresses,|or-for keys.\tis understood as an escape if you really want a tab. - Name the new column, or leave it blank to get the source names joined with underscores.
- Decide about the sources. Keeping them is safer; removing them is what you want when the composite replaces them.
The empty-value option
With skip empty values on, a row missing its middle component doesn't get a doubled separator: Berlin + + DE comes out as Berlin, DE, not Berlin, , DE. That's what you want for display text.
Turn it off when you're building a key. A key must be unambiguous, and skipping empties destroys that: A+B+ and A+ +B both become A-B, so two different records collide. With empties kept you get A-B- and A--B, which stay distinct. Choose a separator that can't appear in the data for the same reason.
FAQ
Where does the new column go?
At the end. To move it, use extract columns and list the positions in the order you want — extraction preserves the order you name.
Can I add fixed text as well as columns?
Only via the separator, which is inserted between every pair. For a prefix or suffix, add a constant column first with append column, then include it in the join.
Is the combined column safe to join on?
Yes, provided you build it identically on both sides — same columns, same order, same separator, and skip empty off. Then TSV join on that single column is equivalent to a composite-key join.
What's the awk version?
awk -F'\t' -v OFS='\t' '{print $0, $2" "$3}' f.tsv appends a joined field — though it will also join the header row's names, which this page handles for you.
Privacy
100% client-side. No upload. See the privacy policy.