Commit 0152ae76 authored by Ian Dennis Miller's avatar Ian Dennis Miller

Make functions easier to load

parent 518f93f2
alias csv.collapse_lines='perl -pe "s/\\\\\n/ /" -'
alias csv.remove_quotes='sed "s/\"//g"'
alias csv.split='sed -e "s/,/\\n/g"'
function csv.select_index() { awk -F, "{print \$$1}" }
function csv.limit() { head -n$1 }
function csv.cat() { cat $1 | csv.collapse_lines | csv.remove_quotes }
function csv.names() { csv.cat $1 | csv.limit 1 | csv.split }
function csv.sum() { awk '{s+=$1} END {printf "%.0f", s}' - }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment