#!/usr/bin/perl # # dbcolrename # Copyright (C) 1991-1998 by John Heidemann # $Id: dbcolrename,v 1.14 2003/05/23 04:17:13 johnh Exp $ # # This program is distributed under terms of the GNU general # public license, version 2. See the file COPYING # in $dblibdir for details. # sub usage { print <getopt) { $ch = $dbopts->opt; if (0) { } else { &usage; }; }; &readprocess_header; while ($#ARGV > 0) { ($old, $new) = @ARGV; die ("$prog: unmatched rename pair: ``$old'' without new value.\n") if ($#ARGV < 1); shift; shift; die("$prog: duplicate column names ``$new''.\n") if (defined($colnametonum{$new})); if (defined($colnametonum{$old})) { $oldn = $colnametonum{$old}; &col_unmapping ($old); &col_mapping ($new, $oldn); } else { die ("$prog: column ``$old'' does not exist.\n"); }; }; &write_header(); while () { print; }; print "# | $prog ", join(" ", @orig_argv), "\n"; exit 0;