Skip to content

Instantly share code, notes, and snippets.

@pyrocat101
Last active May 18, 2018 08:48
Show Gist options
  • Save pyrocat101/10435755 to your computer and use it in GitHub Desktop.
Save pyrocat101/10435755 to your computer and use it in GitHub Desktop.
CS35L - Homework 2
# get content in <td>...</td>
sed -n 's/<td>\(.*\)<\/td>/\1/gip' | \
# remove empty lines
grep -v "^\s*$" | \
# remove odd lines
sed -n '1~2!p' | \
# remove <u> tags
sed 's/<u>\(.*\)<\/u>/\1/gi' | \
# convert apostrophe (` -> ')
sed "s/\`/'/g" | \
# split comma separated words into lines
sed "s/, /\n/g" | \
# remove leading and trailing whitespace per line
sed "s/^\s*//g;s/\s*$//g" | \
# remove non-Hawaiian words (by vocabulary)
grep -i "^[pk'mnwlhaeiou]*$" | \
# convert to all lower case
tr '[A-Z]' '[a-z]' | \
# remove duplicate and sort
sort -u
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment