Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions movies2.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Interstellar
Inception
High School Musical
Incredibles
Princess Diaries
A Cinderella Story
23 changes: 23 additions & 0 deletions wagescript.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#hello! here is our code

#alex - 1

cat wages.csv | cut -d , -f 1,2 | sed 's/,/ /g' |sort -u | uniq -u > wages3.csv

#jessica - 2

#gives sorted data, top earner and worst earner
echo "The gender, years experience and wage for the highest earner is"
cat wages.csv | cut -d , -f 1,2,4 | sort -t\, -nrk3 | head -n 1

echo "The gender, years experience and wage for the lowest earner is"
cat wages.csv | cut -d , -f 1,2,4 | sort -t\, -nrk3 | sed '2,3293d' | head -n 2 | tail -n 1

echo "The number of females in the top ten earners in this data set"
cat wages.csv | cut -d , -f 1,2,4 | sort -t\, -nrk3 | head -n 10 | egrep -c 'female'

#question 3
echo "The difference in wages between 16 and 12 year educations is"
val1=$(cat wages.csv | cut -d , -f 3,4 | sed 's/,/ /g' | egrep -w 16 | sort -n -k 2 | head -n 1 | cut -d " " -f 2)
val2=$(cat wages.csv | cut -d , -f 3,4 | sed 's/,/ /g' | egrep -w 12 | sort -n -k 2 | head -n 1 | cut -d " " -f 2)
echo $val1 - $val2 | bc