Currently, in CQRLOG 2.5.1 of Ubuntu 21.04, QSL export for label printing is broken due to a FreePascal bug:
TRegExpr exec: empty input string.
Version 2.5.2 contains a fix, though. Now I had the choice between these unpleasent options:
- Go through dependency hell by using the CQRLOG PPA for Ubuntu. This repo however has got some unresolvable dependencies. Attempts to work around these moved my system from MariaDB back to MySQL, resulting in a migration of the system database directory, what made a “downgrade” back to MariaDB another huge stumbling block. Luckily, I could switch back to 2.5.1 on MariaDB again.
- Go through dependency hell by trying to compile CQRLOG from source. Either I’d have to mess with several odd development packages on my system directly, or by using a Docker container. This was a path I didn’t really want to take.
- Delay printing QSL cards for several months until Ubuntu 21.10 is out (which hopefully contains that fix).
Couldn’t I somehow work around that bug? After all, I just wanted to dump certain log entries to a CSV. This could be done using an ordinary MySQL client! And this is the procedure to do so:
Start CQRLOG, this launches a MySQL (MariaDB) server instance in the CQRLOG data directory, which is ~/.config/cqrlog/database by default, listening on port 64000. Now, simply connect to it:
$ mysql -h 127.0.0.1 -P 64000
Use the desired database:
> use cqrlog001;
Query, using the columns you usually export:
> select qsodate, time_on, callsign, mode, freq,
rst_s, qsl_via, remarks, stx, stx_string
into outfile ’/path/to/qsl_test.csv’
fields terminated by ’,’
from cqrlog_main
where qsl_s in (’SMB’, ’SB’);
The resulting CSV is already almost in the usual format, except for the date. In Vim, I did these transformations:
:%s/^\(\d\+\)-\(\d\+\)-\(\d\+\)/\3-\2-\1
:%s/-05-/-May-
:%s/-06-/-Jun-
:%s/-07-/-Jul-
etc.
As soon as I was satisfied with the result (in gLabels), I marked these QSL as sent:
> update cqrlog_main set qsl_s = ’B’ where qsl_s = ’SB’;
> update cqrlog_main set qsl_s = ’MB’ where qsl_s = ’SMB’;
Querying around in that table is also a good opportunity for one’s own statistics.