<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">#!/bin/csh
set findir = /users/rsg/observatory/buoy/pml/E1/postdeploy

foreach file(*.RAW)
   set stem = `echo $file:r | sed 's/F//'`
   echo $stem
   set yyyy = `echo $stem | cut -c1-4`
   set jjj = `echo $stem | cut -c5-7`

   process_storx_binary $file cal/Hse297a.cal  cal/E1_buoy_offsets_${yyyy}.cal &gt; ${stem}.txt
 
   mkdir $findir/$stem
   echo "Creating GPS file ..."
   echo "Year Serial Time Lat Lon" &gt; $findir/$stem/${stem}_GPS.txt
   cat ${stem}.txt | grep GPS | sed 's/GPS//' | nawk '/\./{printf("%04d %03d %5.2f %7.3f %7.3f\n",year,julian,$1,$2,$3)}' year=$yyyy julian=$jjj  &gt;&gt; $findir/$stem/${stem}_GPS.txt

   echo "Creating MPB file ..."
   echo "Year Serial Time Prs Tmp Hum Dir Spd" &gt; $findir/$stem/${stem}_MPB.txt
   cat ${stem}.txt | grep MPB | sed 's/MPB//' | nawk '/\./{printf("%04d %03d %5.2f %6.1f %5.1f %5.1f %5.1f %4.1f\n",year,julian,$1,$2,$3,$4,$5,$6)}' year=$yyyy julian=$jjj &gt;&gt; $findir/$stem/${stem}_MPB.txt

   echo "Creating WQM file ..."
   echo "Year Serial Time SST Sal Oxy Chl NTU" &gt; $findir/$stem/${stem}_WQM.txt
   cat ${stem}.txt | grep WQM | sed 's/WQM//' | sed '/3600\.00/d' | nawk '/\./{printf("%04d %03d %5.2f %5.2f %5.2f %6.2f %5.2f %5.2f\n",year,julian,$1,$2,$3,$4,$5,$6)}' year=$yyyy julian=$jjj &gt;&gt; $findir/$stem/${stem}_WQM.txt

   echo "Creating CDM file ..."
   echo "Year Serial Time CDM" &gt; $findir/$stem/${stem}_CDM.txt
   cat ${stem}.txt | grep CDM | sed 's/CDM//' | nawk '/\./{printf("%04d %03d %5.2f %5.2f\n",year,julian,$1,$2,$3)}' year=$yyyy julian=$jjj &gt;&gt; $findir/$stem/${stem}_CDM.txt

   echo "Creating HSE file ..."
   set wavelengths = `cat ${stem}.txt | grep HSE | sed 's/HSE//' | nawk '$0 ~ /Time/ {print $0}'` 
   echo "Year Serial $wavelengths" &gt; $findir/$stem/${stem}_HSE.txt
   cat ${stem}.txt | grep HSE | sed 's/HSE//' | nawk '$0 !~ /Time/ {print year " " julian $0}' year=$yyyy julian=$jjj &gt;&gt; $findir/$stem/${stem}_HSE.txt
   
   echo "Creating NLF file ..."
   echo "Year Serial Time NLF" &gt; $findir/$stem/${stem}_NLF.txt
   cat ${stem}.txt | grep NLF | sed 's/NLF//' | nawk '/\./{printf("%04d %03d %5.2f %5.2f\n",year,julian,$1,$2)}' year=$yyyy julian=$jjj &gt;&gt; $findir/$stem/${stem}_NLF.txt

   /bin/mv $file $findir/$stem
   
   /bin/rm ${stem}.txt
   
end



exit(0)

</pre></body></html>