donav: files=`ls *.RAW | cut -d. -f1` for file in $files do awk -f awkit $file.RAW > $file.navdep doneThe AWK script "awkit" simply extracts any line of information in the HYPACK file that contains either the string "GPGGA" or "SDDBT" and writes this information to a new file with the extension navdep.
awkit: { if ($0 ~ /GPGGA|SDDBT/) { print $0 } }This process step and all subsequent process steps were performed by the same person - VeeAnn A. Cross.
doholdhypack: files=`ls *.navdep | cut -d. -f1` for file in $files do awk -f awkholdhypack $file.navdep > $file.holdhypack done awkholdhypack: BEGIN { FS = "," }{
FS = "," depth = -9999 if ($1 ~ /GPGGA/) { utctime = $2 latdeg = substr($3,1,2) latmin = substr($3,3,6) declat = latdeg + (latmin/60) londeg = substr($5,1,3) lonmin = substr($5,4,6) declon = -1 * (londeg + (lonmin/60)) if (NR==1) { holddepth = -9999 } else { printf("%s, %9.6f, %9.6f, %5.1f\n", holdutctime, holddeclon, holddeclat, holddepth) } holdutctime = utctime holdutcdate = utcdate holddeclon = declon holddeclat = declat holddepth = -9999 } if ($1 ~ /SDDBT/) { if ($4 != "") { depthreal = $4 holddepth = depthreal } else { depthreal = -9999 holddepth = -9999 } } } END { printf("%s, %9.6f, %9.6f, %5.1f\n", holdutctime, holddeclon, holddeclat, holddepth) }
cat 201_1213.holdhypack \ 202_1414.holdhypack \ 203_1441.holdhypack \.204_1600.holdhypack > jd103hypack.csv