Skip to content

Instantly share code, notes, and snippets.

@timothyha
Last active January 2, 2018 02:29
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 timothyha/1fb1e6aa4cd2d3dd6aa50068097923a7 to your computer and use it in GitHub Desktop.
Save timothyha/1fb1e6aa4cd2d3dd6aa50068097923a7 to your computer and use it in GitHub Desktop.
FIDE rating list breakdown
# download ratings in TXT format at https://ratings.fide.com/download.phtml and unzip
# wget http://ratings.fide.com/download/standard_rating_list.zip
# unzip standard_rating_list.zip
# less than 1200
cat standard_rating_list.txt | grep -v "FOA" | awk 'BEGIN{C=0;R=1200}{X=substr($0,114,4);if(X<R)C=C+1}END{S=R+99;print "0000-1199 "C}';
# from 1200 to 2900, go by groups of 100
RATING=1200
while [ $RATING -lt 3000 ]; do
cat standard_rating_list.txt | grep -v "FOA" | awk -v R="$RATING" 'BEGIN{C=0}{X=substr($0,114,4);if((X>=R)&&(X<R+100))C=C+1}END{S=R+99;print R"-"S" "C}';
let RATING=RATING+100
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment