#!/bin/csh

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

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

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

