#!/bin/csh

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

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

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

