The best option is to keep track of which are the top 5 instead of trying to figure it out when reading the file. Another option is to use a hash table instead of an ini file and then you can save and filter it and quickly find out the top 5 or 10 or whatever without having to keep constant track of who is top.