I need a script in any language to capitalize the first letter of every word in a file.
Thanks for all the answers.
Stackoverflow rocks!
Very basic version for AMOS Basic on the Amiga — only treats spaces as word separators though. I'm sure there is a better way using PEEK and POKE, but my memory is rather rusty with anything beyond 15 years.
FILE$=Fsel$("*.txt")
Open In 1,FILE$
Input #1,STR$
STR$=Lower$(STR$)
L=Len($STR)
LAST$=" "
NEW$=""
For I=0 to L-1
CUR$=MID$(STR$,I,1)
If LAST$=" "
NEW$=NEW$+Upper$(CUR$)
Else
NEW$=NEW$+$CUR$
Endif
LAST$=$CUR$
Next
Close 1
Print NEW$
I miss good old AMOS, a great language to learn with... pretty ugly though, heh.