I then ran an AWK script on the resulting GPS files to generate a single comma-delimited text file with the information of interest. I then used VI to add the appropriated header line.
AWK script awkit:
BEGIN {
FS=","
}
{
FS= ","
ARGC = 2
if ($1=="$GPRMC") {
gpstime = $2
hr = substr($2,1,2)
min = substr($2,3,2)
sec = substr($2,5,2)
latdeg = substr($4,1,2)
latmin = substr($4,3,6)
londeg = substr($6,2,2)
lonmin = substr($6,4,6)
declat = latdeg + (latmin/60)
declon = (londeg + (lonmin/60)) * -1
date = $10
day = substr($10,1,2)
month = substr($10,3,2)
year = substr($10,5,2)
}
else if ($1=="$SDDPT") {
depth = $2
printf("%8.6f, %8.6f, %s:%s:%s, %s, %s, %s\n",declon, declat, hr, min, sec, date, depth, ARGV[2])
}
}
The running of the script was initiated with a simple executable shell script under CYGWIN (a Unix like environment that runs under Windows
"doawk":
files=`ls *.gps | cut -d. -f1`
for file in $files
do
awk -f awkit $file.gps $file >> resnav_jd249.txt
done