Last active
January 2, 2018 02:29
-
-
Save timothyha/1fb1e6aa4cd2d3dd6aa50068097923a7 to your computer and use it in GitHub Desktop.
FIDE rating list breakdown
This file contains 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
# 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