Golang CSV file splitter that allows you to partition by percentages
As this tool is written in golang, you will need to download and install golang.
To build and install, use the go get
tool:
go get github.com/jacobseth/csvpart
CSVpart will read a file from a provided filename, and partition it into a number of files based on the provided percentages.
NAME:
CSVPart - Separate a CSV file into smaller ones based on percentage
USAGE:
csvpart [global options] command [command options] [arguments...]
COMMANDS:
help, h Shows a list of commands or help for one command
GLOBAL OPTIONS:
--filename value name of file to be partitioned
--headers value number of header lines to duplicate (default: 0)
--whole Assume provided percentage is a part of a whole, and fill the remainder (default: false)
--help, -h show help (default: false)
Resultant files are named based on the index of their respective percentages, in
the following format: %d_some_data.csv
.
csvpart --headers 1 --filename some_data.csv 60 40
csvpart --headers 1 --filename some_data.csv --whole 60
Pull/Feature requests welcome! :)