Rick, M5RJC got in touch to ask if there was a way to sort the repeaters in the CSV by distance from a grid square.
I took a few days to think how to best implement this without having to undergo a major rewrite of the existing code (which I do not have the time for right now). The solution I came up with was to optionally add an extra column called “Distance” to the CSV and add the distance in miles from the centre of the Maidenhead grid locator to the repeater in this column. That way, the user can edit the CSV in their preferred editor, such as Microsoft Excel or Libreoffice Calc, and sort by distance. The distances are a massive approximation as the locations on the ukrepeater.net website are often very vague.
The downside to this is if the distance column isn’t removed, it could make the import unpredictable. It is likely that a lot of software will just ignore unrecognised columns, but this cannot be guaranteed. Some may give error messages, other may just all out refuse to open the CSV.
The only other way I can think of doing this is to write a temporary database on the server each time according to grid square and then generate the CSV from this. It seems a messy way to do it, though it would clearly work. The downsides would be higher server loads and longer load times. I might have a play with it some time, but I’m in the process of relocating across the country right now so another time maybe!