Skip to content

Bruzzese-Nemera-Inskeep submission#2

Open
bruzecruise wants to merge 20 commits into
lyy005:masterfrom
bruzecruise:master
Open

Bruzzese-Nemera-Inskeep submission#2
bruzecruise wants to merge 20 commits into
lyy005:masterfrom
bruzecruise:master

Conversation

@bruzecruise

Copy link
Copy Markdown

Bruzzese-Nemera-Inskeep submission

Comment thread Exercise4.sh

#Q3
#Minimum wages of 12 vs 16 years school
val1=$(cat wages.csv | sed 's/,/ /g' | awk -F, '$3 = "12"' | sort -n -k "4" | cut -d ' ' -f 4 | head -2 | tail -1)

@lyy005 lyy005 Sep 28, 2017

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You already replaced "," to " ". So for awk, you may want to use: awk -F ' '
Also, for awk, you want to use == instead of =

Then the command would be:
cat wages.csv | sed 's/,/ /g' | awk -F ' ' '$3 == "12"' | sort -n -k "4" | cut -d ' ' -f 4 | head -1
cat wages.csv | sed 's/,/ /g' | awk -F ' ' '$3 == "16"' | sort -n -k "4" | cut -d ' ' -f 4 | head -1

-0.25 points for this question

Comment thread Exercise4.sh
sed '1d' a.tmp.csv | sort -n | uniq >>u.gender.year.csv
rm a.tmp.csv
echo "unique gender and experience .csv complete"

@lyy005 lyy005 Sep 28, 2017

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternatively, you can use:

cat wages.csv | grep -v gender | cut -d , -f 1,2 | sort -u | tr ',' ' ' | sort -k1,1d -k2,2n >categories.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants