GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - chasebuilds/csv-combine-split: Combine a folder of CSV and Excel files into one with aligned columns, or split a big file by value or size.

BranchesTags
Open more actions menu

Latest commit

 

History

5 Commits
5 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
benchmark
benchmark
 
 
demo
demo
 
 
docs
docs
 
 
samples
samples
 
 
src/csv_combine_split
src/csv_combine_split
 
 
tests
tests
 
 
.gitignore
.gitignore
 
 
BENCHMARK.md
BENCHMARK.md
 
 
LICENSE
LICENSE
 
 
LIMITATIONS.md
LIMITATIONS.md
 
 
README.md
README.md
 
 
pyproject.toml
pyproject.toml
 
 

Repository files navigation

csv-combine-split

ci Python 3.11+ MIT license

Live demo: try it in your browser. Drop in your own file or run the bundled sample with one click. The real package runs in the page with Pyodide, so files never leave your browser.

The live demo after running the sample: the tool's summary, result tabs and output table

Combines a folder of CSV and Excel files into one file. Columns are lined up by name, so a different column order or a header like "Order ID" vs "order_id" still lands in the right place, and a JSON alias map handles renamed headers ("Client" means "customer"). Every row gets a source_file column, and files missing columns are listed. It also splits one big file into separate files by a column value or by row count. Encoding (utf-8, utf-8 with BOM, cp1252) and delimiter (comma, semicolon, tab, pipe) are detected per file. Everything runs offline.

Measured result

Seeded fake order files with known contents were combined and every output cell was checked against the planted records. The table below is written by the benchmark script from a real run, not typed by hand. Method: BENCHMARK.md.

Measure Result
Input files (CSV utf-8, utf-8-sig, cp1252; comma, semicolon, tab, pipe; .xlsx) 20
Rows in / rows out 100,000 / 100,000
Rows with every column aligned to truth 100.0% (100,000 of 100,000)
Output columns 6 (Date, Order ID, amount, customer, Region, source_file)
Files reported with differing columns 6 of 6 planted
Split by region: rows kept 100,000 in 4 files
Split by 7,000 rows: rows kept 100,000 in 15 files
Combine speed 56,088 rows/sec (1.78 s)

The planted files are clean apart from the variations listed, so this is a best case. LIMITATIONS.md lists what a real file can do to it.

Quick start

Windows (on macOS or Linux use .venv/bin/ in place of .venv\Scripts\):

python -m venv .venv
.venv\Scripts\pip install -e .
.venv\Scripts\csvcs combine folder/ -o all.xlsx
.venv\Scripts\csvcs combine folder/ -o all.csv --aliases aliases.json
.venv\Scripts\csvcs split big.csv --by region -o out/
.venv\Scripts\csvcs split big.csv --rows 50000 -o out/ --format xlsx

aliases.json maps a header variant to the name you want:

{"Client": "customer", "amount_usd": "amount", "OrderNo": "order_id"}

Header matching also ignores case, spaces, dashes and underscores without any alias.

Development

.venv\Scripts\pip install -e ".[dev]"
.venv\Scripts\python -m ruff check .
.venv\Scripts\python -m mypy
.venv\Scripts\python -m pytest --cov
.venv\Scripts\python -m benchmark.run

License

MIT, Chase Builds.

More from Chase Builds

  • address-normalizer: Messy US mailing addresses to standardized, split fields, with duplicates grouped. (live demo)
  • table-export-extension: Export any web table to Excel. No data leaves the browser. (live demo)
  • spreadsheet-diff: Compare two versions of a spreadsheet, cell by cell. (live demo)

All projects, sorted by industry · chasebuilds.github.io

About

Combine a folder of CSV and Excel files into one with aligned columns, or split a big file by value or size.

chasebuilds.github.io/csv-combine-split/

Topics

automationcsvetlexcelpython

Resources

Readme
MIT license

Contributing

Contributing

Security policy

Security policy
Activity

Stars

2 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.