[Xastir] UI-View32 logfiles vs. Xastir logfiles

Jeremy McDermond mcdermj at xenotropic.com
Mon Nov 9 23:24:48 EST 2009


On Nov 9, 2009, at 4:14 PM, Curt, WE7U wrote:

> On Mon, 9 Nov 2009, Jeremy McDermond wrote:
>
>> I wrote this up really quick, but it appears I'm a little late:
>
> Depends...  Yours preserves timestamps and writes them to the file
> in the same manner that Xastir writes them.  Xastir doesn't read
> back or use timestamps from logfiles currently, but it's still nice
> to have them for other purposes.  I was hoping somebody would come
> along and convert the timestamps too.  I could have implemented that
> but it would have taken more time and wouldn't have been as clean as
> your implementation anyway.  Since Xastir doesn't use them (yet) I
> skipped that part for now.
>
> Did you test it on the sample file?

I tested it on the sample file given, and it seems to work okay.  I  
loaded it up in Xastir, and it seemed to load up the stations properly.

> If you release it under GPL I can swap yours for mine in CVS.

I'm attaching a copy of the script with a GPL license and some  
verbiage at the top.  Use it as you see fit.  I have changed the  
regexp a little.  I was using {0,1} and figured that was rather  
idiotic when ? would do.  I also anchored the regexp so it matches  
lines correctly.  I also have it in my svn repository at https://www.xenotropic.com/ham-svn 
.  It's read-only for anonymous, so you can check a copy out from  
there too.

> -- 
> Curt, WE7U.                         <http://www.eskimo.com/~archer>
>   APRS:  Where it's at!                    <http://www.xastir.org>
>  Lotto:  A tax on people who are bad at math. - unknown
> Windows:  Microsoft's tax on computer illiterates. - WE7U.
> The world DOES revolve around me:  I picked the coordinate system!"
> _______________________________________________
> Xastir mailing list
> Xastir at lists.xastir.org
> http://lists.xastir.org/cgi-bin/mailman/listinfo/xastir
>

----- FILE STARTS HERE -----

#!/usr/bin/perl
#
# uiv2xtr.pl - Converts UI-View format log files to Xastir.
#
# Copyright (c) 2009 Jeremy McDermond, NH6Z
#
# $Id: uiv2xtr.pl 15 2009-11-10 04:22:50Z mcdermj $
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA   
02111-1307, USA.
#
# Look at the README for more information on the program.
#

use strict;

use Date::Parse;
use Date::Manip qw(UnixDate ParseDateString);

$ENV{TZ} = 'GMT';

open MYFILE, "<", $ARGV[0];

while(<MYFILE>) {
	if(!/^([0-9]{4}-[0-9]{2}-[0-9]{2}) ([0-9]{2}:[0-9]{2}:[0-9]{2}) ([0-9] 
{2}:[0-9]{2}:[0-9]{2})R ([0-9A-Z-]+>([0-9A-Z-]+,?)+) <UI Len=[0-9]+>:\s 
+$/) { next };

	my $time = str2time("$1 $2");
	my $path = $4;
	my $packet = <MYFILE>;
	chomp($packet);

	print "# $time " . UnixDate(ParseDateString("epoch $time"), "%a %b %e  
%H:%M:%S %Z %Y") . "\n";
	print "$path:$packet\n";
}

close(MYFILE);


--
Jeremy McDermond (NH6Z)
Xenotropic Systems
mcdermj at xenotropic.com






More information about the Xastir mailing list