CSVLane

Runs in this tab. Nothing is uploaded. Check it yourself

MERGE CSV

Merge CSV files

Stack the rows of several files into one, or add columns from a second file by a matching ID. CSV and Excel .xlsx, free, no account, and your files stay in this browser tab.

MERGE PREVIEW

Merged file

Two ways to merge

  • Stack files when every file holds the same kind of record: monthly exports, one file per store or region, survey batches. The rows of file 2 go under the rows of file 1, and so on, in the order of the list.
  • Join by a column when the second file describes the rows of the first: customer details for a list of orders, prices for a list of SKUs. Each row of A gets the columns of the B row with the same key, the way VLOOKUP or XLOOKUP would fill them in Excel.

The example on the page shows both: two branch exports whose headers are spelled differently, and an order list joined to a customer list. Switch the tab above to see the other one.

How stacking lines up columns

By default columns are matched by name, ignoring capitals, spaces, hyphens and underscores, so Order ID, order_id and order-id are one column, in any order. A column that only some files have is added on the right and left empty for the rows of the other files; the page names each one, so a misspelt header does not slip through.

Choose By position for files without a usable header: column 1 goes under column 1. The first file’s header is kept, and the header row of every other file is dropped.

  • Source file adds a column with the name of the file each row came from.
  • Remove exact duplicate rows drops a row that repeats an earlier one in every merged column, keeping the first. The count next to the box shows how many there are before you tick it. To remove repeats by one column, such as an email address, download the result and open it in the duplicate remover.
  • Empty rows are skipped. Values are not changed: no trimming, and numbers, dates and leading zeros stay exactly as written.

How the join works

Pick the key column in each file, such as customer_id in both. A key matches when the values are the same after removing spaces at the start and end; tick Ignore upper/lower case if one file writes c-01 and the other C-01.

  • Every row of A keeps all rows of the first file. Rows without a match get empty B columns, and the page says how many.
  • Only rows found in both leaves out rows of A that have no match.
  • Every row of A and of B also adds the B rows nobody matched, at the end, with the key filled in.

When B repeats a key, its first row is used and the repeats are counted. Rows of A are never copied, so the result has as many rows as A (plus unmatched B rows for the third option). This is how a spreadsheet lookup behaves; a database join would repeat the A row once for every match. If a B column has the same name as an A column, it is renamed with “(B)”.

What you can download

CSV with a comma or semicolon, or tab-separated text, in UTF-8 with a byte order mark for Excel or without one for scripts. Formula protection adds an apostrophe before cells that start with =, +, - or @, so a spreadsheet shows them instead of running them. Or download an Excel .xlsx with one sheet, a bold frozen header and filters; every value is stored as text, so IDs such as 00721 keep their zeros.

Limits

Up to 20 files of 15 MB each. An Excel workbook contributes its first visible sheet. Files in Windows-1252 and other encodings are detected; a file with a broken quote is shown with the line to fix and is not merged. The preview shows the first 200 rows; the download has every row. Nothing is uploaded: the files are read by this browser tab.

Related