#! /usr/bin/perl # QRZlogfmt.pl - Input: Amateur Radio Contact Data # Output: QSOs in Cabrillo Format # # James M. Lynes Jr. - KE4MIQ # Created: July 2, 2021 # Last Modified: 07/02/2021 - Initial Version # 07/18/2021 - Change command input method # 07/21/2021 - Commented out appending a header file # and added notes. # # Notes: Very basic script to input Ham Radio contact data # and output in Cabrillo Log format used in # entering several(ARRL) radio contests. # Fields in this file are space delimited. Another script # (adif.pl)converts this file into ADIF(Amateur Data # Interchange Format) for import into QRZ logging software. # Nine or eleven fields are created depending on the exchange. # 59 59 - 9 fields 1E WCF 3A WNY - 11 fields use strict; use warnings; use Term::ReadKey; my $cmd; my $mycall = "KE4MIQ"; my $mymode = "PH"; my $date = ""; my $time; my $freq; my $call; my $sent = ""; my $received = ""; #open(my $infile, "<", 'cabloghdr.txt') or die "Can't open cabloghdr.txt: $!"; open(my $outfile, ">", 'QRZlog.txt') or die "Can't open QRZlog.txt: $!"; #while(defined(my $line = <$infile>)) { # Copy header file to output file # chomp($line); # print $outfile "$line\n"; # print "\n\nQRZ Log Formatter\n"; print "===================\n"; while(1) { print "Command(D, Q, X): "; ReadMode 'cbreak'; $cmd = uc(ReadKey(0)); # Read command character ReadMode 'normal'; print"\n"; if($cmd eq "D") { # Change to new date getdate(); } elsif($cmd eq "X") { # Exit last; } elsif($cmd eq "Q") { # Enter/Print the QSO getqso(); print "QSO: $freq $mymode $date $time $mycall $sent $call $received\n\n"; print $outfile "QSO: $freq $mymode $date $time $mycall $sent $call $received\n"; } } #close($infile); close($outfile); sub getdate() { # Get QSO date print "\nDate(YYYY-MM-DD): "; chomp($date = ); $date = uc($date); print "\n"; } sub getqso() { # Get variable QSO data print "Time(UTC): "; chomp($time = ); $time = uc($time); print "Frequency(KHz): "; chomp($freq = ); print "Call: "; chomp($call = ); $call = uc($call); print "Sent: "; chomp($sent = ); $sent = uc($sent); print "Received: "; chomp($received = ); $received = uc($received); }