A fast, terminal-based Python tool to split large CSV files by file size (MB) or line count — with automatic file size tracking, progress bar, and post-split data integrity check.
- 📁 File selection dialog — no need to type full paths
- 📦 Split by size or number of lines
- 📊 Accurate size splitting — no file exceeds your limit
- 🔍 Data integrity check — confirms all rows are preserved
- 📜 Progress bar (tqdm) for live feedback

After selecting your CSV, choose:
size
→ set max file size in MB (e.g., 500)lines
→ set max lines per file (excluding header)
Each output file will be named like:
- yourfile_split_1.csv
- yourfile_split_2.csv
After splitting, the script re-counts all rows across all split files and compares with the original. You'll be notified if any rows are lost.
python csv_splitter.py
You’ll be prompted to:
- Select your input .csv
- Choose an output folder
- Choose split type: size or lines
- Provide a value (MB or line count)
Python 3.7+
tqdm for progress bar
Install dependencies:
pip install tqdm
Splitting a 611MB CSV into 500MB parts:
Split by: size
Max size: 500 MB
Split files saved as: mydata_split_1.csv, mydata_split_2.csv
✅ All rows verified: No data lost.
##Notes
- Output files retain the header (optional)
- File sizes are accurately tracked using real byte counts
- Fully terminal-based with modern file dialog (no GUI dependencies)