csvpart

command module
v0.0.0-...-7fa054f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 14, 2020 License: MIT Imports: 11 Imported by: 0

README

Go Report Card

CSVPart

Golang CSV file splitter that allows you to partition by percentages

Installation

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

Basic usage

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.

Examples

Split a CSV file 60% - 40%
csvpart --headers 1 --filename some_data.csv 60 40
Split a CSV file 60% - ~40% using --whole flag
csvpart --headers 1 --filename some_data.csv --whole 60

Pull/Feature requests welcome! :)

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL