added export_opernam.pl R_1_25
authordjk <djk>
Mon, 26 Apr 1999 19:39:56 +0000 (19:39 +0000)
committerdjk <djk>
Mon, 26 Apr 1999 19:39:56 +0000 (19:39 +0000)
Changes
perl/export_opernam.pl [new file with mode: 0755]

diff --git a/Changes b/Changes
index 8c985771bf61c26a8986a8fb397408a7477e70ea..38d12170b96f4019c1a992e61307e5c900eecf1a 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,6 +1,17 @@
+26Apr99=======================================================================
+1. added set/user command as a hack, please use this with care, there is
+very little checking.
+2. added export_opernam.pl which is a basic reader of AK1A opernam.dat files
+to stdout
 25Apr99=======================================================================
 1. Fixed problem with filtered spots not coming out.
 2. Added the possibility of filtering on channel callsign
+20Apr99=======================================================================
+1. altered order of undefing and closing of user file in an attempt to make 
+corruptions/missing users less likely.
+2. made messages that are addressed to the node call appear to the alias call
+3. check dates much more rigourously.
+4. ignore SIGTERM and SIGINT during shutdown of the cluster
 15Mar99=======================================================================
 1. added $actiondata to filter line to allow per action data such as no of hops
 2. fixed a silly problem in talk for non-existant callsigns
diff --git a/perl/export_opernam.pl b/perl/export_opernam.pl
new file mode 100755 (executable)
index 0000000..2107c1a
--- /dev/null
@@ -0,0 +1,32 @@
+#!/usr/bin/perl
+#
+# export a standard ak1a opernam.dat file into CSV format.
+#
+# Copyright (c) 1999 Dirk Koopman G1TLH
+#
+#
+
+sub export
+{
+       my $rec = shift;
+       my @f = unpack "SA13A23SA12A6SSSSA1CSSSA1A80A1A13A1", $rec;
+       my $f;
+
+       # clean each field
+       for $f (@f) {
+               my @a = split m{\0}, $f;
+               $f = $a[0] if @a > 1;
+       }
+
+       print join '|', @f;
+       print "\n";
+}
+
+die "Need an filename" unless @ARGV;
+open IN, $ARGV[0] or die "can't open $ARGV[0] ($!)";
+
+while (sysread(IN, $buf, 196)) {
+       export($buf);
+}
+close IN;
+exit(0);