Skip to content

Instantly share code, notes, and snippets.

View ersatzryan's full-sized avatar

Ryan G ersatzryan

View GitHub Profile
@ersatzryan
ersatzryan / csvsplit
Created October 16, 2019 16:19
CSV Splitter
#!/bin/bash
NUMLINES=4000
while [[ $# -gt 0 ]]; do
case "$1" in
-l|--lines) NUMLINES="$2"; shift; shift;;
-h|--help ) echo -e "Usage: csvsplit [-l line_count] file\n -l, --lines: Number of lines to split\n -h, --help: Show this message"; exit 1;;
-* ) echo "Unknown option: $1"; exit 1;;
-- ) shift; break;;
* ) FILE="$1"; shift;;