X-Git-Url: http://gb7djk.dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2Fdxoldtonew.pl;h=9ad356054b2ed3b9e5146c5a50ee5bfb063148c4;hb=bdfc958f3d0fa912d20a020ac1a6cd2c79a22729;hp=d850ad2e7b9290ff778e3b0304465dae04494fd6;hpb=65744dd1e30165cd280502ee1a05c0c640023303;p=spider.git diff --git a/perl/dxoldtonew.pl b/perl/dxoldtonew.pl index d850ad2e..9ad35605 100755 --- a/perl/dxoldtonew.pl +++ b/perl/dxoldtonew.pl @@ -6,21 +6,25 @@ use Date::Parse; use Spot; +use Prefix; sysopen(IN, "../data/DX.DAT", 0) or die "can't open DX.DAT ($!)"; open(OUT, ">../data/dxcomma") or die "can't open dxcomma ($!)"; -system("rm -rf $Spot::prefix"); -Spot->init(); +Prefix::load(); + +$fn = Spot::prefix(); +system("rm -rf $fn/*"); while (sysread(IN, $buf, 86)) { ($freq,$call,$date,$time,$comment,$spotter) = unpack 'A10A13A12A6A31A14', $buf; - $date =~ s/^\s*(\d+)-(\w\w\w)-(19\d\d)$/$1 $2 $3/og; - $time =~ s/^(\d\d)(\d\d)Z$/$1:$2 +0000/; - $d = str2time("$date $time"); + $d = $date =~ s/^\s*(\d+)-(\w\w\w)-(19\d\d)$/$1 $2 $3/o; + $t = $time =~ s/^(\d\d)(\d\d)Z$/$1:$2 +0000/o; + $dt = undef; + $dt = str2time("$date $time") if $d && $t; $comment =~ s/^\s+//o; - if ($d) { - Spot->new($freq, $call, $d, $comment, $spotter); + if ($dt ) { + Spot::add($freq, $call, $dt, $comment, $spotter); } else { print "$call $freq $date $time\n"; }