Skip to content Skip to footer

How to Merge Multiple CSV Files

You can combine batched CSV exports from Genealogy Assistant into a single file using a variety of methods.

Quick Start
Microsoft Excel (Windows)

Use Power Query to combine multiple CSV files from a folder automatically.

  1. Place all CSV files you want to merge into a single folder.
  2. Open Excel and go to Data → Get Data → From File → From Folder.
  3. Browse to your folder and click OK.
  4. Click Combine → Combine & Load.
  5. In the preview dialog, verify columns look correct and click OK.
  6. Excel imports all files into a single table. Save as CSV via File → Save As.

Tip: Power Query remembers your folder, so you can add new CSVs and click Refresh to include them automatically.

Microsoft Excel (Mac)

Note: For merging many files on Mac, the Terminal or Python methods below are faster.

Excel for Mac doesn’t support folder imports, so you’ll import each CSV individually and combine them.

  1. Open Excel and go to Data → Get Data (Power Query) → Text/CSV.
  2. Select your first CSV file and click Get Data.
  3. In the preview, verify the data looks correct and click Load.
  4. Repeat steps 1-3 for each additional CSV file, each loads into a new sheet.
  5. Create a new sheet called “Combined” and copy the header row from any sheet.
  6. From each data sheet, select all rows below the header, copy, and paste into Combined (below existing data).
  7. Save as CSV via File → Save As → CSV UTF-8.
Google Sheets (Web)

Import multiple CSVs into separate sheets, then combine them using a formula or copy-paste.

  1. Create a new Google Sheet.
  2. Go to File → Import and upload your first CSV. Choose Insert new sheet(s).
  3. Repeat for each additional CSV file.
  4. Create a new sheet called “Combined” for your merged data.
  5. Copy the header row from any sheet to row 1 of Combined.
  6. Below the header, use this formula to stack all data (adjust sheet names):
    ={Sheet1!A2:Z; Sheet2!A2:Z; Sheet3!A2:Z}
  7. Download via File → Download → Comma-separated values.

Note: The formula approach keeps data linked. For static data, use copy-paste instead.

LibreOffice Calc / OpenOffice (Windows / Mac / Linux)

Manually combine CSVs by opening each file and copying data into a master sheet.

  1. Open LibreOffice Calc and create a new spreadsheet.
  2. Go to Sheet → Insert Sheet from File.
  3. Select your first CSV. In the import dialog, ensure comma is selected as delimiter.
  4. Repeat for each CSV, each imports as a new sheet.
  5. Go to the first data sheet, select all data rows (skip headers on subsequent sheets), and copy.
  6. Paste into a master sheet. Repeat for all sheets.
  7. Save via File → Save As and choose Text CSV (.csv).
Terminal (Mac / Linux)

Use command-line tools for fast, scriptable merging. This is ideal for large files or automation.

  1. Open Terminal and navigate to your CSV folder:
    cd /path/to/your/csv/folder
  2. If all files have headers, keep header from first file only:
    head -1 file1.csv > combined.csv && tail -n +2 -q *.csv >> combined.csv
  3. If files have no headers, simply concatenate:
    cat *.csv > combined.csv

Tip: Use tail -n +2 to skip the first line (header) of each file.

PowerShell (Windows)

Windows’ built-in scripting tool handles CSV merging with header deduplication.

  1. Open PowerShell (search in Start menu).
  2. Navigate to your folder:
    cd "C:\path\to\your\csv\folder"
  3. Run this command to merge all CSVs (headers handled automatically):
    Get-ChildItem -Filter *.csv | Import-Csv | Export-Csv combined.csv -NoTypeInformation

Note: This method reads all files into memory. For very large files (500MB+), consider using Python instead.

Online Tools (Any Browser)

Web-based tools require no installation, you can do it all from your browser.

  1. Visit a CSV merge tool such as:
  2. Upload your CSV files (usually drag-and-drop).
  3. Configure options like header handling and column matching.
  4. Click Merge and download your combined file.

Privacy Note: Files are uploaded to external servers. For sensitive data, consider offline methods instead.

Python Script (Any OS)

A flexible solution for recurring tasks or merging hundreds of files efficiently.

  1. Ensure Python is installed. Open Terminal or Command Prompt.
  2. Install pandas if needed:
    pip install pandas
  3. Save this script as merge_csv.py in your CSV folder:
import pandas as pd
import glob

files = glob.glob("*.csv")
combined = pd.concat([pd.read_csv(f) for f in files], ignore_index=True)
combined.to_csv("combined.csv", index=False)
print(f"Merged {len(files)} files into combined.csv")
  1. Run the script:
    python merge_csv.py

Tip: Modify the glob pattern (e.g., "exports_*.csv") to merge only specific files.