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...


In reply to Linux/Perl Cabrillo Logfile Creation Script by jmlynesjr

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.