#!/usr/bin/perl

# ----------------------------------------------------------------
# John Kerl
# kerl.john.r@gmail.com
# 2001/01/03
#
# Sample input:
#
#   Here is some data which I am going to make into a table in ASCII.
#   2 4 8 3 6 c b 5 a 7 e f d 9 1
#   3 5 f 2 6 a d 4 c 7 9 8 b e 1
#   4 3 c 5 7 f 9 2 8 6 b a e d 1
#   5 2 a 4 7 8 e 3 f 6 d c 9 b 1
#   9 d f e 7 a 5 b c 6 3 8 4 2 1
#   b 9 c d 6 f 3 e 8 7 4 a 2 5 1
#   d e a b 6 8 2 9 f 7 5 c 3 4 1
#   e b 8 9 7 c 4 d a 6 2 f 5 3 1
#
# After running the "Here is ..." line through ":.!dashes" in vim:
#
#   Here is some data which I am going to make into a table in ASCII.
#   ---- -- ---- ---- ----- - -- ----- -- ---- ---- - ----- -- ------
#   2 4 8 3 6 c b 5 a 7 e f d 9 1
#   3 5 f 2 6 a d 4 c 7 9 8 b e 1
#   4 3 c 5 7 f 9 2 8 6 b a e d 1
#   5 2 a 4 7 8 e 3 f 6 d c 9 b 1
#   9 d f e 7 a 5 b c 6 3 8 4 2 1
#   b 9 c d 6 f 3 e 8 7 4 a 2 5 1
#   d e a b 6 8 2 9 f 7 5 c 3 4 1
#   e b 8 9 7 c 4 d a 6 2 f 5 3 1
#
# After running the whole paragraph through colprint:
#
#   Here is some data which I am going to make into a table in ASCII.
#   ---- -- ---- ---- ----- - -- ----- -- ---- ---- - ----- -- ------
#      2  4    8    3     6 c  b     5  a    7    e f     d  9      1
#      3  5    f    2     6 a  d     4  c    7    9 8     b  e      1
#      4  3    c    5     7 f  9     2  8    6    b a     e  d      1
#      5  2    a    4     7 8  e     3  f    6    d c     9  b      1
#      9  d    f    e     7 a  5     b  c    6    3 8     4  2      1
#      b  9    c    d     6 f  3     e  8    7    4 a     2  5      1
#      d  e    a    b     6 8  2     9  f    7    5 c     3  4      1
#      e  b    8    9     7 c  4     d  a    6    2 f     5  3      1
#
# ----------------------------------------------------------------

$lno = 0;
while ($line = <>) {
	$lno++;
	chomp $line;
	print $line . "\n";
	if ($lno == 1) {
		$line =~ s/[^ \t]/-/g;
		print $line . "\n";
	}
}
