<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">#!/bin/csh -f

set downloaddir = /users/rsg/observatory/buoy/pml/download/E1/ODAS51
set wavecodedir = /users/rsg/observatory/buoy/pml/bin/AMOS2XBinaryCoder-1.0
set finaldir = /users/rsg/observatory/buoy/pml/download/E1
set UnitID_atm = '300025010444580'

set waveheader = `cat $wavecodedir/bf-128.csv | head -1`
echo $waveheader &gt; $finaldir/E1buoy_waves.csv

foreach infile ( `find $downloaddir -name ${UnitID_atm}\*.sbd -size +300c` )
   /bin/scp $infile $wavecodedir/dataoutput.sbd
   set outputdata = `$wavecodedir/DataformatDecoder.py`
   echo $outputdata | sed 's/\[//' | sed 's/\]//' &gt;&gt; $finaldir/E1buoy_waves.csv
end

# extract the data for the short form table
set short_metdata_waves = `cat $finaldir/E1buoy_waves.csv | tail -1 | awk 'BEGIN{FS=","}{print $19,"-9.99",$22,$25}'`
echo $short_metdata_waves

exit(0)

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