A simple perl script that does this: (via http://www.go4expert.com/forums/showthread.php?t=2138)
sub ucwords {
$str = shift;
$str = lc($str);
$str =~ s/\b(\w)/\u$1/g;
return $str;
}
while () {
print ucwords $_;
}
Then you call it with
perl ucfile.pl < srcfile.txt > outfile.txt