Iain-
You need to write a parser for the country file data into your environment of choice
Then you need to write logic which finds the ‘deepest’ match for the callsign you have, so you take into account all the possible exceptions first
Then you need to ensure you regularly update the country file data in your application
It isn’t a straight callsign list mapped to country- such a thing does not exist for the UK and never will, since our prefixes are variable by current location (and also are optional, apart from 2# calls). And there is no public list of active calls. So a rules based approach is the only practical way.