I've been working on the logging project where time permits. I've found a couple of really dumb things in CTY.DAT though. For example, the entity "Juan de Nova & Europa" lists for alternate prefixes, J and E. So my code so far thinks every Japanese or E* station qualifies. I've written in ADIF import function. The log data and country data are all imported into Postgres tables using DBI. I'm trying to write a DXCC summary report. The challenge at the moment is to filter the data to prevent this: primary_prefix|call |name | qso_date| qslrdate|band --------------+---------+---------------------+----------+----------+---- 3A |3A2K |Monaco |09-08-2000| |20M 3D2 |3D2AA |Fiji |05-05-2000| |20M 3D2 |3D2AA |Fiji |06-12-2000| |20M 3D2/r |3D2AA |Rotuma |05-05-2000| |20M 3D2/r |3D2AA |Rotuma |06-12-2000| |20M 3D2AA is listed specifically for 3D2/r, but of course also fits 3D2*. G |GU3WHN |England |04-09-1999| |20M G |GU3WHN |England |11-09-1999| |20M G |G0UPF |England |25-02-2000| |20M G |M5AHW |England |08-08-2000| |20M G |GB5HQ |England |09-08-2000| |20M G |M5AHW |England |09-08-2000| |20M GU |GU3WHN |Guernsey |01-09-1999| |20M Same problem here: GU is a subset of G. I think it should be good enough to look for the longest prefix as being the most specific. Just to let you all know I'm still working on it anyway, Hamish -- Hamish Moffatt VK3SB <[EMAIL PROTECTED]> <[EMAIL PROTECTED]>