Splitting CSV Files in Python
In this article, see a code snippet that splits CSV files in Python.
Join the DZone community and get the full member experience.Join For Free
Sometimes it is necessary to split big files into small ones. In this brief article, I will share a small script which is written in Python. Maybe you can develop it further. However, if the file size is bigger you should be careful using loops in your code.
Let's assume your input file name input.csv. The code will split it into new files with names input_1.csv, ..., input_10.csv.,...
Opinions expressed by DZone contributors are their own.