#!/bin/csh

echo 'Deleting entries for HEC ...'
\rm HEC.*.tbl Output.HEC.* Error.HEC.*
sqlplus user/passwd@db @HEC.sql

echo 'Splitting HEC in multiple time spans ...'
../../bin/Split_Station HEC

foreach i (HEC.*.tbl)
echo 'Populating ', $i
../../bin/Populate_Station $i > Output.$i:r
mv Error.log Error.$i:r
end

