Skip to content

Instantly share code, notes, and snippets.

@mrnormandy
mrnormandy / csv_splitter.py
Last active August 11, 2020 13:43 — forked from jrivero/csv_splitter.py
A Python CSV splitter
import os
def split(filehandler, delimiter=',', row_limit=500000,
output_name_template='filename_%s.csv', output_path=r'filepath', keep_headers=True,line_terminator='\n'):
"""
Modified to work in python 3
Splits a CSV file into multiple pieces.
A quick bastardization of the Python CSV library.