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 205_1220.holdhypack \ 008_1251.holdhypack \ 006_1407.holdhypack \ 007_1631.holdhypack \ 004_1635.holdhypack \ 004_1734.holdhypack \ 003_1834.holdhypack \ 002_1856.holdhypack \ 033_1944.holdhypack \ 033_2014.holdhypack \ 033A2014.holdhypack \ 033B2014.holdhypack \ 033_2015.holdhypack \ 033A2015.holdhypack \ 033_2016.holdhypack \ 033_2017.holdhypack \ 123_2025.holdhypack \ 123_2026.holdhypack \ 123A2026.holdhypack \ 034_2026.holdhypack \ 035_2035.holdhypack \ 036_2056.holdhypack \ 037_2109.holdhypack \ 038_2127.holdhypack \ 039_2140.holdhypack \ 040_2159.holdhypack \ 041_2214.holdhypack \ 011_2244.holdhypack \ 010_2254.holdhypack \ 013_2315.holdhypack > jd104hypack.csv