#!/bin/tcsh

# make the .txt files 12 to 12Z...DRB...10/19/2005.

foreach file (`ls -1 *.txt`)
echo "Working on the file ${file}..."
rm -f ./$file.2 >&! /dev/null
sed '$d' $file >> $file.2
mv $file.2 $file
rm -f ./$file.2 >&! /dev/null
goto skip

set vrbl = `basename $file .txt`
rm -f ./temp.file >&! /dev/null
rm -f ./temp2.file >&! /dev/null
rm -f ./temp3.file >&! /dev/null
echo "12_${vrbl}.gif" >> ./temp.file
echo "13_${vrbl}.gif" >> ./temp.file
echo "14_${vrbl}.gif" >> ./temp.file
echo "15_${vrbl}.gif" >> ./temp.file
echo "16_${vrbl}.gif" >> ./temp.file
echo "" >> ./temp2.file
echo "04_${vrbl}.gif" >> ./temp2.file
echo "05_${vrbl}.gif" >> ./temp2.file
echo "06_${vrbl}.gif" >> ./temp2.file
echo "07_${vrbl}.gif" >> ./temp2.file
echo "08_${vrbl}.gif" >> ./temp2.file
echo "09_${vrbl}.gif" >> ./temp2.file
echo "10_${vrbl}.gif" >> ./temp2.file
echo "11_${vrbl}.gif" >> ./temp2.file
echo "12_${vrbl}.gif" >> ./temp2.file
cat ./temp.file ./${vrbl}.txt ./temp2.file > ./temp3.file
mv -f ./temp3.file ./${vrbl}.txt 
rm -f ./temp.file >&! /dev/null
rm -f ./temp2.file >&! /dev/null
rm -f ./temp3.file >&! /dev/null

skip:
end
