#!/usr/bin/perl #Convert Cabrillo log files to the format used by the #Ontario QSO Party Contest Logger software. # #Created April 23, 2007 by Kevin Cozens, VE3SYB. $log_type = $ARGV[0]; $qth_out = $ARGV[1]; $log_type =~ tr/a-z/A-Z/; $qth_out =~ tr/a-z/A-Z/; $qso_cnt = 0; $line = 1; while ($qso = ) { chop($qso); if ($qso =~ /^QSO:/) { $qso =~ tr/a-z/A-Z/; if ($log_type ne "TR") { ($dummy, $freq, $mode, $date, $time, $call_out, $rst_out, $qth_out, $call_in, $rst_in, $qth_in) = split(/\s+/, $qso); } else { ($dummy, $freq, $mode, $date, $time, $call_out, $call_in, $rst_out, $rst_in, $qth_in) = split(/\s+/, $qso); } $date =~ s/^20//; ($year, $month, $day) = split(/-/, $date); #convert frequency information to band if ($freq > 1000) { $freq = int($freq/1000); if ($freq >= 1) {$band = "160";} if ($freq >= 3) {$band = "80";} if ($freq >= 7) {$band = "40";} if ($freq >= 14) {$band = "20";} if ($freq >= 21) {$band = "15";} if ($freq >= 28) {$band = "10";} } else { if ($freq > 0) { if ($freq >= 1.2) {$band = ".23";} if ($freq >= 50) {$band = "6";} if ($freq >= 144) {$band = "2";} if ($freq >= 222) {$band = "1.2";} if ($freq >= 432) {$band = ".70";} } else #$freq is numerically 0 { if ($freq = "A") {$band = "6";} if ($freq = "B") {$band = "2";} if ($freq = "C") {$band = "1.2";} if ($freq = "D") {$band = ".70";} if ($freq = "F") {$band = ".23";} } } printf "%3s %02d/%02d/%02d %04d %s %-13s %-3d%-6s %-3d%-6s 1 \n", $band, $day, $month, $year, $time, $mode, $call_in, $rst_out, $qth_out, $rst_in, $qth_in; ++$qso_cnt; } ++$line; }