Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@erikw
Created January 10, 2012 22:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save erikw/1591575 to your computer and use it in GitHub Desktop.
Save erikw/1591575 to your computer and use it in GitHub Desktop.
Get LADOK mean score from HTML-page(lang: en)
grep -Pzoi "(?<=>)[3-5G]&nbsp;</td>(\s*(?:\\n|<td[^>]*>[^<]*</td>))*\s*<\/tr>\s*<tr>\s*<td[^>]*>[^<]*</td>\s*<td[^>]*>examiner" < LADOK.HTML | grep -Pzoi "^[3-5G](?=&nbsp;</td>)" | sed -e 's/g/3/i' | awk 'BEGIN{sum=0;count=0}{sum+=$1;count++}END{print sum/count}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment