forked from mshaffer16/Biocomp_tutorial6
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtutorial6.txt
More file actions
24 lines (16 loc) · 1003 Bytes
/
Copy pathtutorial6.txt
File metadata and controls
24 lines (16 loc) · 1003 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#question 1
#creating file with unique number of years worked and gender
cat wages.csv | grep -v "gender" |cut -d , -f 1,2 | sed 's/,/g' | sort -v |uniq > uniquewages.txt
#question 2
echo "Information on Highest Earner"
cat "$1" | grep -v "gender | cut -d , -f 1,2,4 |sed 's/,/g' | sort -Vk3 | tail -n 1
echo "Information of Lowest Earner"
cat "$1" | grep -v "gender | cut -d , -f 1,2,4 |sed 's/,/g' | sort -Vk3 | head -n 1
echo "Number of Females in Top Ten Earners"
cat "$1" | grep -v "gender | cut -d , -f 1,2,4 |sed 's/,/g' | sort -Vk3 | tail -n 10 | cut -d " " -f 1 | sort| uniq -c | grep "female"
#question 3
val1=$(cat "$1" | grep -v "gender" | cut -d , -f 3,4 | sort -n | sed 's/,/ /g' | grep "12" | head -n 1 | cut -d " " -f 2)
val2=$(cat "$1" | grep -v "gender" | cut -d , -f 3,4 | sort -n | sed 's/,/ /g' | grep "16" | head -n 1 | cut -d " " -f 2)
dif="$val2-$val1"
echo "The effect of graduating college on minnimum wage is the difference of:"
echo "$val2 $val1" |awk '{prin $1-$2}'