Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Excel Splitter

CI Python 3.9+ License: MIT

Split one big spreadsheet into many files — either one file per category (e.g. per region, client, or month) or into fixed-size chunks of N rows. The exact inverse of merging.

Built for the everyday request: "split this master sheet into a separate file for each ___."

📖 New here? Read the full step-by-step guide: How to Split an Excel File Into Multiple Files on ExcelGuru.io.

Features

  • 🗂️ Split by column — one file per unique value (--by region)
  • ✂️ Split by row count — fixed-size chunks (--rows 1000)
  • 📤 Output as .xlsx or .csv
  • 🏷️ Safe, readable file names generated from the column values
  • 🧩 Reads .csv, .xlsx, .xls

Installation

git clone https://github.com/Synth88Labs/excel-tool-splitter.git
cd excel-tool-splitter
pip install -r requirements.txt

Requires Python 3.9+.

Usage

python split_excel.py <input> --by COLUMN [-o out_dir] [--format xlsx|csv]
python split_excel.py <input> --rows N     [-o out_dir] [--format xlsx|csv]

Quick start (try it on the included sample data)

# One file per region
python split_excel.py sample_data/sales.csv --by region -o split_output

# Chunks of 4 rows each, as CSV
python split_excel.py sample_data/sales.csv --rows 4 -o chunks --format csv

Options

Option Description
--by COLUMN Split into one file per unique value in COLUMN
--rows N Split into chunks of N rows each
-o, --output-dir Folder for the output files. Default: split_output
--format xlsx or csv. Default: xlsx
--prefix Optional prefix for output file names
--sheet NAME For Excel input, read a specific sheet (default: first)

--by and --rows are mutually exclusive — pick one mode per run.

Example

Splitting sales.csv with --by region produces:

split_output/
  West.xlsx
  East.xlsx
  North.xlsx
  South.xlsx

Each file contains only that region's rows.

Pairs perfectly with Excel/CSV Merger

Split and merge are two halves of the same job:

python split_excel.py all_clients.xlsx --by client      # split one -> many
python merge_excel.py ./client_files -o combined.csv     # many -> one (excel-tool-merger)

Excel/CSV Merger · Excel Report Generator · Excel Data Cleaner

Running the tests

pip install pytest
python -m pytest

📚 Learn More — Free Excel Tutorials

Level up your Excel and automation skills with free, practical guides at ExcelGuru.io — formulas, automation, VBA, and more.

👉 Browse all free Excel tutorials on ExcelGuru.io »

License

MIT — see LICENSE.

About

Split one spreadsheet into many files — by column value or fixed-size row chunks. The inverse of merging.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages