-
Notifications
You must be signed in to change notification settings - Fork 0
Home
kirilligum edited this page Dec 16, 2014
·
3 revisions
Welcome to the duckly wiki!
This project is about command line data analysis rather than just a set of written tools. I'll put here useful comman line commands. Later, I will organize them into a reference manual.
get the index of the column with a specific name to be used in other commands within $(...)
:
head -n1 data.csv| tr , ' '| cat -n |grep target| cut -f1
The following converts it to a function:
function colidx() { head -n1 $2|tr , \\n|cat -n|grep $1 |cut -f1; }
you can use it to list see the column with a specific name target
:
cut -d, -f$(colidx target train.csv) train.csv