#!/usr/bin/perl -w # # dbrecolize # Copyright (C) 1997-1998 by John Heidemann # $Id: dbrecolize,v 1.10 2003/05/23 04:15:48 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 ($ch eq 'd') { $debug++; } else { &usage; }; }; &usage if ($#ARGV != 0); my($new_fs_code) = @ARGV; &readprocess_header; my($new_fsre, $new_outfs) = fs_code_to_fsre_outfs($new_fs_code); @coloptions = grep(!/^-F/, @coloptions); push(@coloptions, "-F$new_fs_code") if ($new_fs_code ne 'D'); # default &write_header(); # switch outfs $outfs = $new_outfs; $outfs = $new_outfs; # suppress warning @f = (); # suppress warning while () { &pass_comments && next; &split_cols; foreach (@f) { die("$prog: existing field contains new field separator: ``$_'' contains ``$new_fsre''.\n") if (/$new_fsre/); }; &write_cols; }; print "# | $prog ", join(" ", @orig_argv), "\n"; exit 0;