#!/bin/csh -f

#edit-bbt-1 

#Edit script for btt bathymetry data to remove data lines which
#contain no position data.  This is evidenced by the appearance
#of 999999's in the line and/or by the appearance of 00000000's
#in the line.  Edited file retains the same name as the
#original filename and the original data is saved in a file 
#called original-name.1 (i.e. a .1 is appended to the name)

# Restrition.  Input parameter must be a single filename, with
# no wild card characters.

# Assumes output to current directory

# R. Groman
# 6 February 1996

set filename=$1
set filename=./${filename[1]:t}.1
set outputname=$1
mv $1 $filename
set today=`date +%D`
echo "#Remove lines with missing positions via edit-bbt-1, R. Groman, $today" > $outputname
cat ${filename} | sed -e /999999/d -e /000000/d  >> $outputname
echo " "
echo "    $outputname edited for bad position information"
echo " "
