I have a set of C identifiers for which I would like to make the first letter capital, through a pipe to tr. The problem is selecting the first character from the currently selected text, so I can pipe on it. As an example, I want to take id1, xl2, rs4, a and turn them into Id1, Il2, Is4, A Is there a way to select the first character of each identifier so I can pipe it to tr "[a-z]" "[A-Z]"? Thanks, Beirne -- ------------------------------------------------------------------------------- Beirne Konarski | Reading maketh a full man, conference a beirnek@summitis.com | ready man, and writing an exact man. "Untouched by Scandal" | -- Francis Bacon -------------------------------------------------------------------------------
Boy, there's nothing like reading your own mail! The example should show id1, xl2, rs4, a becoming Id1, Xl2, Rs4, A rather than the meaningless set of values I used. Sorry and Thanks, Beirne -- ------------------------------------------------------------------------------- Beirne Konarski | Reading maketh a full man, conference a beirnek@summitis.com | ready man, and writing an exact man. "Untouched by Scandal" | -- Francis Bacon -------------------------------------------------------------------------------
Forwarded message:
>the trick here is knowing about +#0 and -#0, which go to the
>end of the address. (-0 and +0 go to the end of the line).
>
>,x/[A-ZA-Z0-9]+/ -#0,+#1 | tr A-Z A-Z
I tried this but did not get good results. I found that the whole word
was being capitalized, not just the first letter. Am I missing
something?
Beirne
--
-------------------------------------------------------------------------------
Beirne Konarski | Reading maketh a full man, conference a
beirnek@summitis.com | ready man, and writing an exact man.
"Untouched by Scandal" | -- Francis Bacon
-------------------------------------------------------------------------------