# Copyright (c) 2005 Fabian Kurz, DJ1YFK # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. # This script was put together quickly, for 9A5CW and may not be useful for # anybody or anything else than the intended purpose ;-) use warnings; use strict; my ($a, $b, $c); my $lastband=40; # QSO of last band my $lasttime='0000'; # time of last bandchange my $logfile = $ARGV[0]; unless (defined $logfile) { print "Please specify filename!\n"; exit } open LOGFILE, $logfile; while (my $line = ) { if ($line =~ /^QSO:.+?1 $/) { my @qso = split(/\s+/, $line); if (&freq2band($qso[1]) eq $lastband) { next; } # no QSY elsif (&timediff($lasttime, $qso[4]) < 10) { print "This QSO: ".$qso[4]." Last QSO $lasttime \n"; $lastband = &freq2band($qso[1]); print $line; } else { print "Last Bandchange: $lasttime\n"; print "Actual Time : $qso[4]\n"; print "Time on Band : ".&timediff($lasttime, $qso[4])."\n\n"; $lasttime = $qso[4]; $lastband = &freq2band($qso[1]); } } } close LOGFILE; $lasttime='0000'; $lastband='40'; open LOGFILE, $logfile; while (my $line = ) { if ($line =~ /^QSO:.+?0 $/) { my @qso = split(/\s+/, $line); if (&freq2band($qso[1]) eq $lastband) { next; } # no QSY elsif (&timediff($lasttime, $qso[4]) < 10) { print "This QSO: ".$qso[4]." Last QSO $lasttime \n"; $lastband = &freq2band($qso[1]); print $line; } else { print "Last Bandchange: $lasttime\n"; print "Actual Time : $qso[4]\n"; print "Time on Band : ".&timediff($lasttime, $qso[4])."\n\n"; $lasttime = $qso[4]; $lastband = &freq2band($qso[1]); } } } close LOGFILE; sub freq2band { my $freq = shift; if ($freq >= 1800 and $freq <= 1900) { return 160; } elsif ($freq >= 3500 and $freq <= 4000) { return 80; } elsif ($freq >= 7000 and $freq <= 7300) { return 40; } elsif ($freq >= 14000 and $freq <= 14350) { return 20; } elsif ($freq >= 21000 and $freq <= 21450) { return 15; } elsif ($freq >= 28000 and $freq <= 29700) { return 10; } return 666; # not supposed to happen ;-) } sub lastqso { my $hour = substr($lasttime,0,2); my $min = substr($lasttime,2,2); if ($min > 49) { $hour++; $min -= 50; } return "$hour.$min"; } sub timediff { my $first = shift; my $second = shift; if (substr($first,0,2) eq substr($second,0,2)) { return substr($second,2,2)-substr($first,2,2); } else { return "60"; } }