3 # convert an Ak1a DX.DAT file to comma delimited form
11 sysopen(IN, "../data/DX.DAT", 0) or die "can't open DX.DAT ($!)";
12 open(OUT, ">../data/dxcomma") or die "can't open dxcomma ($!)";
17 system("rm -rf $fn/*");
19 while (sysread(IN, $buf, 86)) {
20 ($freq,$call,$date,$time,$comment,$spotter) = unpack 'A10A13A12A6A31A14', $buf;
21 $d = $date =~ s/^\s*(\d+)-(\w\w\w)-(19\d\d)$/$1 $2 $3/o;
22 $t = $time =~ s/^(\d\d)(\d\d)Z$/$1:$2 +0000/o;
24 $dt = str2time("$date $time") if $d && $t;
25 $comment =~ s/^\s+//o;
27 Spot::add($freq, $call, $dt, $comment, $spotter);
29 print "$call $freq $date $time\n";