-
Notifications
You must be signed in to change notification settings - Fork 0
bash_tricks
mschechter19 edited this page Sep 25, 2017
·
4 revisions
- miller plugin for bash
# convert a csv to a tabular format
mlr --icsv --opprint cat example.csv
# use cut to only show specific fields, call the field by typing the column name!
$ mlr --icsv --opprint cut -f columnname,shape example.csv
- whenever you want to parse out a section of a header, column name, etc... an effective method is to use sed to find and replace a part of the header with a tab then cut out the new field
sed -e 's/thingtocut/\t/' | cut -fx
# sed -e is for finding and replacing an expression
# \t is for tabular
# cut -fx -> x is for the field you would like to cut
- LC=all learn about this... it makes characters on your keyboard smaller bites of informationso that job run faster...