Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Linux/Perl Cabrillo Logfile Creation Script

by jmlynesjr (Chaplain)
on Jul 21, 2021 at 20:12 UTC ( #11135273=CUFP: print w/replies, xml ) Need Help??

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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: CUFP [id://11135273]
Front-paged by Arunbear
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2021-08-05 12:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My primary motivation for participating at PerlMonks is: (Choices in context)








    Results (44 votes). Check out past polls.

    Notices?