http://qs321.pair.com?node_id=11135273

Script to create a simple Amateur Radio Cabrillo Format Log File

Not much out there for Linux users, had to roll my own. Log file created with 200+ entries then converted to ADIF format and uploaded to QRZ.com. Posted here so it can be found by the search engines.

#! /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 scri +pt # (adif.pl)converts this file into ADIF(Amateur Dat +a # Interchange Format) for import into QRZ logging s +oftware. # Nine or eleven fields are created depending on the ex +change. # 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.t +xt: $!"; open(my $outfile, ">", 'QRZlog.txt') or die "Can't open QRZlog.txt: $! +"; #while(defined(my $line = <$infile>)) { # Copy header file to output f +ile # 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 $rec +eived\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 = <STDIN>); $date = uc($date); print "\n"; } sub getqso() { # Get variable QSO data print "Time(UTC): "; chomp($time = <STDIN>); $time = uc($time); print "Frequency(KHz): "; chomp($freq = <STDIN>); print "Call: "; chomp($call = <STDIN>); $call = uc($call); print "Sent: "; chomp($sent = <STDIN>); $sent = uc($sent); print "Received: "; chomp($received = <STDIN>); $received = uc($received); }

James

There's never enough time to do it right, but always enough time to do it over...

Replies are listed 'Best First'.
Re: Linux/Perl Cabrillo Logfile Creation Script
by waltw (Acolyte) on Sep 10, 2021 at 17:27 UTC
    Very nice, James. Thank you for sharing this! 73 Walt KT0D

      Thanks, Walt!

      James

      There's never enough time to do it right, but always enough time to do it over...