Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

comment on

( #3333=superdoc: 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...


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":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2021-08-01 11:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My primary motivation for participating at PerlMonks is: (Choices in context)








    Results (5 votes). Check out past polls.

    Notices?