#!/sw/bin/gawk -f #################### # # gpspoint2utm : Cam Webb campbell.webb@yale.edu # #################### # Thanks to Thomas Schank (http://gpspoint.dnsalias.net) # and Guillaume Cottenceau (http://zarb.org/~gc/resource/gps_utm_wgs84_conv.pl) BEGIN{FS="\""; OFS="," } { command = "gps_utm_wgs84_conv.pl WGS " $6 " " $8; # or path to the script # print data |& command # if it takes from stdin - notr to self command |& getline out; close(command); split(out, tmp, " "); gsub(/\[/, "", tmp[7]); gsub(/\]/, "", tmp[10]); gsub(/\ /, "", $6); gsub(/\ /, "", $8); print $4, $8 " E", $6 " N", tmp[7] " " tmp[8], tmp[9], tmp[10], strftime("%a %b %e %H:%M:%S %Z %Y", $10); }