#!/usr/bin/awk -f
#
# (c) David Frey, November 1998.
#
# This program comes with ABSOLUTELY NO WARRANTY; for details
# refer to the GNU General Public License.
# 
# You should have received a copy of the GNU General Public License
# along with this program;  if not, write to the Free Software
# Foundation, Inc., 59 Temple Place Suite 330, Boston, MA 02111-1307
# USA.

BEGIN { FS="\t"; header=1; line=0; }

/^#/ && header	{ next; }
/^#/ && !header	{ printf("'#' after header found!\n") > /dev/stderr; }
/^[^#]/		{ header=0; line++; }

line == 2	{ for(i=1;i<=NF;i++) {
			if (i != 1) printf("\t");
			for(k=1;k<=$i+0;k++) printf("-");
		  }
		  printf("\n");
		}
line != 2	{ for(i=1;i<=NF;i++) {
			if (i != 1) printf("\t");
			gsub(/-/,"",$i);
			printf("%s", $i);
		  }
		  printf("\n");
	  	}
