Cleaning MMVARI ADIF
My dad use old good MMVARI for digi modes and he has his logbook there too. I like simple straightforward user interface with possibility of user scripting. Only difficulty of that old version of MMVARI is that output ADIF file which does not meet standards of ADIF file.
I made simple python script to correct it. PSK MODE is transformed into PSK31 (no other modes used). When there is not BAND specified, it does mean, it is 4m band. In this case it tries grab frequency from COMMENT field.
For open, parse and save I use own adif module, so final code is very simple.
- import adif
- import re
- log = adif.parse('logy\\OK2BX_fm300112.adi')
- for qso in log:
- ## PSK mode to PSK31
- if qso["mode"] == "PSK":
- qso["mode"] = "PSK31"
- ## 4m band
- if not qso.get("band"):
- qso.setdefault("band", "4m")
- if qso.get("comment"):
- # grab QRG from comment if available
- qrg = re.search("(70.\d+)", qso.get("comment"))
- if qrg:
- qso.setdefault("freq", qrg.group(1))
- qso.setdefault("freq", "70.200")
- ## remove strange "midnight" time off
- if qso.get("time_off") == "000000":
- qso.pop("time_off", None)
- adif.save('ok2bx_mmvari_corr.adi', log)