#! /bin/sh

#
# tabdelim_to_db
# Copyright (C) 2000 by John Heidemann
# $Id: tabdelim_to_db,v 1.1 2000/01/05 23:39:44 johnh Exp $
#

usage () {
    cat 1>&2 <<END
usage: $0 [fields...]

Converts tab-delimited files output from a spreadsheet into jdb format.

Options:
-h    first line of file contains column headings

Sample input:
name    email   test1
Tommy Trojan    tt@usc.edu      80
Joe Bruin       joeb@ucla.edu   85
J. Random       jr@caltech.edu  90

Command:
tabdelim_to_db -h <DATA/gradebook_tab.txt

Sample output:
#h -Ft name email test1
Tommy Trojan    tt@usc.edu      80
Joe Bruin       joeb@ucla.edu   85
J. Random       jr@caltech.edu  90
#  | dbcoldefine name email test1

END
    exit 1
}

test "x$1" = 'x-?' && usage
test "x$1" = 'x-h' && {
	read foo
	set $foo
}

dbcoldefine -F t "$@"

exit 0


