#! /bin/sed -f

# capit.sed -- capitalize words 
# 
# $Id: capit.sed,v 1.4 1998/07/06 20:32:46 cdua Exp $
# Carlos Duarte, 970519

# split words into \n word
s/[a-zA-Z][a-zA-Z]\+/\
&/g

# add conversion table: \n\n table
# table format: <to-char> <from-char>
s/$/\
\
AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz/

# subs every lower case first char
t a
:a
s/\n\(.\)\(.*\n\n.*\)\([A-Z]\)\1/\3\2\3\1/
t a

# cleanup...
s/\n\n.*//
s/\n//g


### colorized by sedsed, a debugger and code formatter for sed scripts
### original script: http://sed.sf.net/grabbag/scripts/cflword5.sed