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.
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) }
catit: cat 008_1213.holdhypack \ 043_1404.holdhypack \ 043_1422.holdhypack \ 044_1423.holdhypack \ 045_1423.holdhypack \ 043_1424.holdhypack \ 044_1424.holdhypack \ 044A1424.holdhypack \ 043_1425.holdhypack \ 043_1426.holdhypack \ 044_1427.holdhypack \ 045_1441.holdhypack \ 045_1500.holdhypack \ 046_1500.holdhypack \ 047_1545.holdhypack \ 048_1606.holdhypack \ 049_1625.holdhypack \ 050_1647.holdhypack \ 118_1723.holdhypack \ 112_1737.holdhypack \ 001_1744.holdhypack \ 023_1744.holdhypack \ 021_1811.holdhypack \ 019_1827.holdhypack \ 017_1857.holdhypack \ 015_1912.holdhypack \ 515_2015.holdhypack \ 518_2024.holdhypack \ 521_2035.holdhypack \ 524_2049.holdhypack \ 527_2101.holdhypack \ 530_2113.holdhypack \ 533_2125.holdhypack \ 536_2138.holdhypack \ 539_2151.holdhypack \ 542_2202.holdhypack \ 545_2211.holdhypack > jd105hypack.csv