Overview
Introduction
Combining two related CSV exports, or trimming a wide CSV down to just the columns you actually need, is a common but fiddly spreadsheet chore when you're working with data outside a full database or spreadsheet application.
This tool handles both jobs: joining two CSVs on a shared key column, or splicing out a chosen subset of columns from one CSV, without needing to open a spreadsheet at all.
What Is CSV Joiner & Column Splicer?
A two-mode CSV utility. Join mode left-joins two CSVs on a key column name you specify, producing one CSV with columns from both. Splice mode extracts a comma-separated list of column names from a single CSV, in the order you list them.
It runs entirely client-side as part of this site's String Tools collection, so nothing you paste is ever uploaded to a server.
How CSV Joiner & Column Splicer Works
Both CSV inputs are parsed with this repo's shared delimited-text parser into rows keyed by their header column names. In Join mode, the right CSV's rows are indexed by the key column's value, then every left row is merged with its matching right row (or left with empty cells if there's no match), and the combined header is the left CSV's columns followed by any right-CSV columns not already present on the left.
In Splice mode, the CSV is parsed the same way, and the output is built by walking the requested column list and pulling that value out of each parsed row, so the output columns can be reordered freely relative to the source.
When To Use CSV Joiner & Column Splicer
Use Join mode when you have two CSV exports that share an identifier column (a user ID, an order ID, a SKU) and want them combined into one file for analysis.
Use Splice mode when a CSV has more columns than you need and you want a smaller file with just the relevant ones, in a specific order, for a report or another tool.
Often used alongside CSV to JSON Converter, JSON to CSV Converter and CSV to TOON.
Features
Advantages
- Handles both a common merge operation and a common column-selection operation in a single tool with a simple mode toggle.
- Reuses this repo's already-tested RFC 4180 CSV parser and serializer, so quoted fields with embedded commas or newlines round-trip correctly in both modes.
- Reports specific, actionable errors (which column or key is missing) instead of failing silently or producing a malformed result.
Limitations
- Join mode only supports a simple one-to-one (or many-to-one) left join on a single key column; it doesn't support joining on multiple columns or performing an inner/right/full join.
- Both CSV inputs in Join mode, and the single input in Splice mode, must be comma-delimited; run the CSV Delimiter Detector and Normalizer first on anything using a different delimiter.
Examples
Best Practices & Notes
Best Practices
- Make sure the key column name is spelled and cased exactly the same in both CSVs before joining; the match is an exact string comparison.
- Deduplicate the right CSV on the key column beforehand if it can contain multiple rows per key, since only the last matching row is used.
- In Splice mode, list only the columns you actually need; the tool will report an error immediately if you mistype a column name.
Developer Notes
Both operations reuse this repo's shared `parseDelimited`/`serializeCsv` helpers from `csv-shared.ts` rather than a second hand-rolled CSV parser. Join builds a `Map<string, Record<string,string>>` from the right CSV keyed by the join column for O(1) lookups per left row; Splice simply projects each parsed row object onto the requested column list in order.
CSV Joiner & Column Splicer Use Cases
- Combining an orders export and a customers export that share a customer ID column into one file for a report
- Enriching a product CSV with a category CSV joined on a shared SKU column
- Trimming a wide analytics export down to just the three or four columns needed for a chart
Common Mistakes
- Assuming Join mode performs an inner join (dropping unmatched left rows); it doesn't, it always keeps every left row and fills unmatched columns with empty cells.
- Forgetting that Splice mode's output column order follows the order you type the column names in, not the order they appear in the source CSV.
Tips
- If the joined or spliced output looks wrong, check the key column and requested column names for stray whitespace or a different case than the CSV's actual header.
- Chain this with Convert CSV to JSON afterward if the next step in your pipeline needs structured JSON instead of CSV.