-
Notifications
You must be signed in to change notification settings - Fork 9
"sampathkumar-yamasaki submission" #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
bsampath17
wants to merge
14
commits into
lyy005:master
Choose a base branch
from
bsampath17:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
8268aba
AEY: add list of three favorite movies
ayamasaki2011 a6b7e2d
added my favs balaji
bsampath17 c1d9e76
AEY: Rank list of 6 movies by preference
ayamasaki2011 411a469
ranked my favs balaji
bsampath17 a5fabf0
AEY: Revise favorite movie rankings
ayamasaki2011 d34395d
AEY: Add shell script to repo - script makes the file space-delimited…
ayamasaki2011 dbb4846
AEY: Modified shell script to print gender, yearsExperience, and wage…
ayamasaki2011 88b657a
AEY: Modified shell scrip to print gender, yearsExperience, and wages…
ayamasaki2011 6c978ff
AEY: Modified shell script to print # of women in top 10 earners
ayamasaki2011 4c8e48f
AEY: Modified shell script to obtain minimum wage for earners NOT gra…
ayamasaki2011 4fdd7c7
AEY: Modified shell script to obtain minimum wage for earners graduat…
ayamasaki2011 289288e
AEY: Modified shell script to calculate effect of graduating college …
ayamasaki2011 a886e13
Modified with #1 and stdout on 2 and 3
bsampath17 20f0202
AEY: Alter script to remove writing results from Part 2 and Part 3 to…
ayamasaki2011 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| #Script prints the following information for a given dataset: | ||
| #Unique gender-yearsExperience combinations | ||
| #Gender, years of Experience, wage for highest earner | ||
| #Gender, years of experience, wage for lowest earner | ||
| #Number of women in top 10 earners | ||
| #Effect of graduating college on the minumum wage of earners | ||
|
|
||
| #Usage: bash earnings.sh filename.csv | ||
| #1: | ||
| cat $1 | sed 's/,/ /g' | cut -d ' ' -f 1,2 | uniq | sort -n -k 1 | sort -n -k 2 | uniq > output_ex4.txt | ||
|
|
||
| #2: | ||
| echo "Highest Earner:" | ||
|
|
||
| cat $1 | sed s/","/" "/g | sort -n -k4 | tail -n 1 | cut -d ' ' -f 1,2,4 | ||
|
|
||
| echo "Lowest Earner:" | ||
|
|
||
| cat $1 | sed s/","/" "/g | sort -n -k4 | head -n 2 | tail -n 1 | cut -d ' ' -f 1,2,4 | ||
|
|
||
| echo "Women in Top 10 Earners:" | ||
|
|
||
| cat $1 | sed s/","/" "/g | sort -n -k4 | tail -n 10 | grep -c "female" | ||
|
|
||
| #3: | ||
| val1=$(cat $1 | sed s/","/" "/g | awk '$3=="12"' | sort -n -k4 | head -n 1 | cut -d ' ' -f 4) | ||
|
|
||
| val2=$(cat $1 | sed s/","/" "/g | awk '$3=="16"' | sort -n -k4 | head -n 1 | cut -d ' ' -f 4) | ||
|
|
||
| echo "Effect of Graduating College on Minimum Wage:" | ||
|
|
||
| echo "$val2-$val1" | bc | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| shawshank redemption | ||
| interstellar | ||
| godfather 2 | ||
| The Princess Bride | ||
| Spirited Away | ||
| Star Wars IV: A New Hope | ||
|
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sort with gender first then by yearExperience. It should be:
cat $1 | sed 's/,/ /g' | cut -d ' ' -f 1,2 | uniq | sort -n -k 2 | sort -n -k 1 | uniq > output_ex4.txt
Or:
cat wages.csv | grep -v gender | cut -d , -f 1,2 | sort -u | tr ',' ' ' | sort -k1,1d -k2,2n > categories.txt