I use an AWK script to reformat the "trimmed" ship's navigation and write the output in the $GPRMC, $SDDPT and $SDMTW strings that the resistivity system will need. The ship system doesn't have temperature, so I used a constant value of 24.3 based on the existing temperature information from the Lowrance system. The new files are *.gps (where * refers to the trim prefix file name)
AWK script awknewgps:
BEGIN {
FS=","
}
{
FS=","
alltime=$2
hr=substr($2,1,2)
min=substr($2,4,2)
sec=substr($2,7,2)
month=substr($1,1,2)
day=substr($1,4,2)
yr=substr($1,9,2)
depth=$5
declon=$4 * -1
londeg=int(declon)
lonmin=(declon-londeg)*60
declat=$3
latdeg=int(declat)
latmin=(declat-latdeg)*60 >printf("$GPRMC,%s%s%s,A,%02d%06.3f,N,%03d%06.3f,W,000.0,0,%s%s%s,0,W*73\n",hr,min,sec,latdeg,latmin,londeg,lonmin,day,month,yr)
printf("$SDDPT,%s,0.0*56\n",depth)
printf("$SDMTW,24.3,C*01\n") }