Source file ⇒ Lab_9.Rmd
Get the rows for:
#egrep no_jedi stars.csv
#egrep [^fe]male stars.csv
File Redirection:
#egrep blaster stars.csv > blaster.csv
Select Name and Height and Sort by Height
#cut -f 1,3 -d ',' stars.csv | sort -k 2 -t ','
How many humans:
#cut -f 12 -d ',' stars.csv | sort | uniq -c
#12 humans
#outputs out a list of all unique cases and sums them up. You can look at human and therefore have the answer.
How many jedis
#cut -f 11 -d ',' stars.csv | sort | uniq -c
#6 jedi
Names of jedis
#cut -f 1,11 -d ',' stars.csv | egrep [^no_]jedi
#Anakin, Luke, Qui-Gon, Obi-Wana, Yoda, Dooku
Names of jedis in alphabetical order
#cut -f 1,11 -d ',' stars.csv | egrep [^no_]jedi | tail -6 | sort -t ','
Table of frequencies for weapons
#cut -f 13 -d ',' stars.csv | sort | uniq -c
Table of frequencies for weapons in decreasing order
#cut -f 13 -d ',' stars.csv | sort | uniq -c | sort -k 1 -t ',' | sort | -r