3 # convert an Ak1a DX.DAT file to comma delimited form
10 sysopen(IN, "../data/DX.DAT", 0) or die "can't open DX.DAT ($!)";
11 open(OUT, ">../data/dxcomma") or die "can't open dxcomma ($!)";
15 while (sysread(IN, $buf, 86)) {
16 ($freq,$call,$date,$time,$comment,$spotter) = unpack 'A10A13A12A6A31A14', $buf;
17 $date =~ s/^\s*(\d+)-(\w\w\w)-(19\d\d)$/$1 $2 $3/og;
18 $time =~ s/^(\d\d)(\d\d)Z$/$1:$2 +0000/;
19 $d = str2time("$date $time");
20 $comment =~ s/^\s+//o;
22 spot->new($freq, $call, $d, $comment, $spotter);
24 print "$call $freq $date $time\n";