#!/usr/bin/perl # Extract a LERAD database from ALAD input file # Copyright (C) 2002, Matt Mahoney. This program is distributed # without warranty under terms of the GNU general public license. # See http://www.gnu.org/licenses/gpl.txt print "23\nDate Time DA1 DA0 DP SA3 SA2 SA1 SA0 SP DUR F1 F2 F3 LEN W1 W2 W3 W4 W5 W6 W7 W8\n"; while (<>) { if (/(\d\d\/\d\d\/\d\d\d\d \d\d:\d\d:\d\d) \d+\.\d+\.(\d+)\.(\d+):(\d+) (\d+)\.(\d+)\.(\d+)\.(\d+):(\d+) \+(\d+) (\w*)\/(\w*)\/(\w*) (\d+) (.*)/){ print "$1 $2 $3 $4 $5 $6 $7 $8 $9 $10 .$11 .$12 .$13 $14"; $_=$15; s/[\x80-\xff]/ /g; split; print " .".substr($_[0],0,16); print " .".substr($_[1],0,16); print " .".substr($_[2],0,16); print " .".substr($_[3],0,16); print " .".substr($_[4],0,8); print " .".substr($_[5],0,8); print " .".substr($_[6],0,8); print " .".substr($_[7],0,8); print "\n"; } }