Free to use, no account

CSV-sammenslåing

Slå sammen flere CSV-filer til én tabell. Kolonner med samme navn plasseres sammen selv om rekkefølgen er forskjellig, og ekstra kolonner fylles med tomme celler. Filene blir i nettleseren.

Velg 2–20 filer, opptil 2 MiB hver og 8 MiB totalt. Behandlingen skjer på denne enheten.

Når overskrifter brukes, kobles kolonner sammen etter nøyaktig navn, og nye kolonner legges til i rekkefølgen de først forekommer. Uten overskrifter kobles kolonnene sammen etter plassering. Overskrifter eller verdier som ligner formler, får en apostrof foran for tryggere åpning i regneark. Skilletegn, filkoding og celletekst normaliseres ellers ikke.

Hvordan slår jeg sammen CSV-filer med ulik kolonnerekkefølge?

Velg to eller flere CSV-filer, og la alternativet for overskriftsrad være slått på. Kolonner kobles sammen etter nøyaktig overskriftstekst, i rekkefølgen de vises første gang. Manglende kolonner blir tomme celler; kolonner uten treff legges til i resultatet.

Veiledning

Slik bruker du csv-merge

CSV Merge joins two or more CSV files into one table by stacking their rows. With the header option on, columns are matched by exact name, so files whose columns come in a different order still line up, and columns that only some files have are added with blank cells. The files are read inside your browser and the merged text is shown for you to copy or download. It does not remove duplicate rows or join files on a key.

Slik gjør du

  1. Choose between 2 and 20 CSV files. Each file can be up to 2 MiB, and together they can be up to 8 MiB. Keep the first-row-headers box ticked if each file starts with column names.
  2. Leave the input delimiter on Detect each file, or force Comma, Semicolon, Tab or Pipe. Pick the delimiter you want in the output.
  3. Press Merge files. A summary line shows how many files, rows and columns were merged and how many cells were protected from spreadsheet formulas.
  4. Review the merged CSV, then press Copy CSV or Download CSV. The download is a file called merged.csv.

Eksempler

Different column order and a new column

Du skriver inn
Fil 1
id,name 001,Ada
Fil 2
name,score,id Lin,9,002
Du får
CSV
id,name,score 001,Ada, 002,Lin,9
Rader
2
Kolonner
3

Columns are matched by their names, so id from the second file lands in the first column. The score column is new, so Ada gets an empty score. The leading zeros in 001 and 002 are kept because every value is handled as text.

Kjørt med verktøyets egen kode.

Cells that look like formulas

Du skriver inn
Fil 1
a,b =SUM(A1),-5 +34 600,-abc
Fil 2
a,b @x,3
Du får
CSV
a,b '=SUM(A1),-5 '+34 600,'-abc '@x,3
Beskyttede celler
4

A cell that starts with =, +, @, or a minus followed by something that is not a plain number gets a leading apostrophe. A real number such as -5 is left alone. This is meant to stop spreadsheets from running the cell as a formula.

Kjørt med verktøyets egen kode.

Files with different delimiters

Du skriver inn
Fil 1
id;name 1;Ada
Fil 2
id,name 2,Bo
Inndataskilletegn
Detect each file
Utdataskilletegn
Comma
Du får
CSV
id,name 1,Ada 2,Bo

The first file uses semicolons and the second uses commas. Detection runs on each file separately, so both are read correctly and the result is written with commas.

Kjørt med verktøyets egen kode.

Når det er nyttig

  • Combine monthly exports from the same system into one yearly table.
  • Merge lists from several people when their spreadsheets have the same columns in a different order.
  • Join a file that has an extra column with one that lacks it, without opening a spreadsheet program.
  • Switch a semicolon-separated export to a comma-separated one while you merge.

Begrensninger

  • Limits are 20 files, 2 MiB per file, 8 MiB in total, 20,000 rows in the result, 100 columns and 200,000 cells. A single cell may hold at most 20,000 characters.
  • With headers on, a file with an empty or repeated column name is rejected, and a stray quote in the middle of an unquoted cell also stops the merge with an error.
  • Rows are stacked, not matched. The tool does not remove duplicates, sort, or join rows on an id.
  • Files are read as text, so a file saved in an unusual encoding can show wrong characters. The output uses line breaks of the CRLF kind.

Tips

  • Check that the same column has the same spelling in every file. 'Name' and 'name' count as two columns.
  • Turn the header box off if your files have no heading row, and the output will use Column 1, Column 2 and so on.
  • Expect an apostrophe on phone numbers that start with a plus sign, and remove it afterwards if you need the original text.

Vanlige spørsmål

Are my CSV files uploaded?

No. The files you select are read and merged by code running in your browser. There is no account, and the page does not send the file contents anywhere. The result stays on your device until you copy or download it.

What if the files have the same columns in a different order?

With the header option on, columns are matched by their exact header text, not by position. The output order follows the first time each header appears, and any missing value is left as an empty cell.

How are commas and quotes inside a cell handled?

A cell with a comma, a line break or a double quote is wrapped in double quotes in the output, and a double quote inside it is doubled. This follows the quoting rules described in RFC 4180, though this tool also supports other delimiters.

Why did an apostrophe appear in front of some values?

Values that start with =, +, @ or a minus that is not a plain number could be run as formulas when opened in a spreadsheet. The tool adds an apostrophe in front of them. This changes the cell text on purpose.

What if one file has no header row?

Untick the first-row-headers option. Then columns are matched by position, and the output gets neutral names such as Column 1. This applies to all selected files, so do not mix files with and without headings.

Can I merge files with different delimiters?

Yes, if input detection is on, because each file is checked on its own. The sniffing looks at the first rows, so for an unusual file choose the delimiter yourself. The output uses the one delimiter you pick.

What are the size limits?

Up to 20 files, 2 MiB each and 8 MiB together, with at most 20,000 rows and 100 columns in total. If you go over, the tool shows an error message and creates no output.

Kilder

Ofte stilte spørsmål

Hvordan slår jeg sammen CSV-filer med ulik kolonnerekkefølge?

Velg to eller flere CSV-filer, og la alternativet for overskriftsrad være slått på. Kolonner kobles sammen etter nøyaktig overskriftstekst, i rekkefølgen de vises første gang. Manglende kolonner blir tomme celler; kolonner uten treff legges til i resultatet.

Lastes CSV-filene opp?

Nei. De valgte filene leses og flettes lokalt i nettleseren. Opptil 20 filer støttes, med grense på 2 MiB per fil og 8 MiB samlet. Konto eller serverbehandling brukes ikke.

Kan jeg slå sammen CSV-filer når kolonnene står i ulik rekkefølge?

Ja. Når overskrifter er slått på, justeres kolonnene etter nøyaktig overskriftstekst, ikke etter plassering. Nye overskrifter legges til i rekkefølgen de først forekommer, og manglende verdier står tomme.

Hva skjer hvis en CSV-fil ikke har en overskriftsrad?

Slå av alternativet for overskriftsrad. Verdiene kobles da sammen etter kolonneplassering, og resultatet bruker nøytrale navn som Kolonne 1. Rader med færre celler fylles ut av CSV-parseren.

Endres formler eller regnearkkommandoer?

Overskrifter og verdier som ligner formler, får en apostrof foran i CSV-resultatet for å redusere risikoen for at de kjøres når filen åpnes i et regnearkprogram. Disse celleverdiene endres med hensikt.