#!/usr/bin/perl -- use POSIX qw(strftime); use Time::Local; $filename = $ARGV[0]; open FILE, $filename; while () { $str .= $_; } close(FILE); @records = split /\n/, $str; print < Converted Trackstick END_HEADER foreach $r(@records) { #Record, Date, Time, Latitude, Longitude, Altitude, Status, Course, GPS Fix, Signal, MapLink, Name @f = split /,/, $r; my $lat = $f[3]; my $lon = $f[4]; $time = $f[1]. $f[2]; if ($time =~ /(\d\d)\/(\d\d)\/(\d\d\d\d) (\d\d):(\d\d) (PM|AM)/) { my $shiftHours = 0; if ($6 eq "PM") { $shiftHours = 12; } else { $shiftHours = 0; } $timestamp = timelocal (0, $5, $4 + $shiftHours, $2, $1, $3); $time = strftime "%Y-%m-%dT%H:%M:%SZ", gmtime($timestamp); print < 0.00 END_PART } } print < END_FOOTER exit;