Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- RJ Trenchard 100281657
- 1:
- #!/usr/bin/awk -f
- $3 ~ /^M$/ {men++ ;}
- $3 ~ /^F$/ {women++;}
- END {printf "%.2f\n", men/women}
- 1.00
- 2d2bde80c396f9e75c994b2b40787058d4f85b02 -
- 2:
- awk '$8 > 85800 {print NR,$0,$8-85800}' emp.txt
- 553 Grey Mora M 30 Single 2017 604-555-6855 85827 27
- 670 Calvin Porter M 40 Single 2015 604-555-6161 85803 3
- 954 Randy Booth M 38 Married 2015 778-555-8544 85898 98
- 1170 Keith Bauer M 55 Married 2016 604-555-3164 85816 16
- 1554 Ayden Sullivan M 27 Married 2016 778-555-2472 85994 194
- b91707c3522dad56b12c62e6bc991c523f28f6da -
- 3:
- #!/usr/bin/awk -f
- {salary[$3]+=$8; sexes[$3]++}
- END {printf "%.2f\n",(salary["M"]/sexes["M"])/(salary["F"]/sexes["F"])}
- 1.00
- 2d2bde80c396f9e75c994b2b40787058d4f85b02 -
- 4:
- TODO
- 5:
- #!/usr/bin/awk -f
- $3~/F/ \
- && $4 <= 26 \
- && $5~/Single/ \
- && $6==2017 \
- && $8 < 44000 { printf "%s %s %s\n",$1,$7,$8 }
- Kaylynn 604-555-1162 43264
- 4b7a13c7ec327f207e997127c85cd0754c28ab32 -
- 6:
- #!/usr/bin/awk -f
- $3~/M/ && $4>=35 {next}
- $3~/M/ && $4>=25 && $5~/Married/ {next}
- $3~/F/ && $4!=36 {next}
- {print $0}
- 338dd3e24004c96c6583325484e31bb3e43a8b46 -
- 7:
- #!/usr/bin/awk -f
- NR == 1{flSalary = $8}
- $8 > clSalary {clSalary = $8}
- $8 < flSalary {flSalary = $8}
- END {printf "%d\n",clSalary-flSalary}
- 42934
- e96255c9054470189a85e97ddc5e38d7a7ed8691 -
- 8:
- #!/usr/bin/awk -f
- $7~/^(604|778|236)/{phoneCount[substr($7,0,3)]++}
- END {printf "%d %d %d\n",phoneCount[604],phoneCount[778],phoneCount[236]}
- 646 693 661
- 55688ba0c57d3edf76f425d57a945e4c92eeaf5c -
- 9:
- #!/usr/bin/awk -f
- length($2)>=length(longest) {
- if (length($2)>length(longest))
- longest = $2;
- else if ($2 > longest)
- longest = $2;
- }
- END {print longest}
- Fitzpatrick
- 33dbe26e85bdbde8637b760f717b9a2fc503570c -
- 10:
- #!/usr/bin/awk -f
- {
- split($7, out, "-")
- subNum[out[3]]++
- }
- END {
- for (i in subNum) {
- if (subNum[i] == 3) sum += i
- }
- print sum
- }
- 35161
- 41069a47411ebf467a7f5359c8935377a477910d -
- 11:
- TODO
- #!/usr/bin/awk -f
- {
- sumRecord=0;
- for (i = 1; i <= NF; i++)
- sumRecord+=$i
- printf "%.2f\n", sumRecord
- }
- 12:
- #!/usr/bin/awk -f
- {
- split($0, line," ")
- asort(line)
- for (i=1;i<=NF;i++) {
- printf "%.2f", line[i]
- if (i!=NF) printf " "
- }
- print ""
- }
- c416b28b72df920bb4ef98eae124ccaad940bd8f -
- 13:
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement