This is a discussion on find & replace help within the Sco Unix forums, part of the Unix Operating Systems category; --> I want to convert to upper case the first letter of all the words in a text document, how ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| Enrique A typed (on Fri, Jan 13, 2006 at 07:06:51PM +0000): | I want to convert to upper case the first letter of all the words in a text | document, how can I do that with vi ? | | do I do something like this : | | :1,$s/ ^[a-z]/ ^[A-Z]/g | ^ ^ | blank blank | space space You think coding filePro's uplow edit is child's play? Think again! :-) -- JP ==> http://www.frappr.com/cusm <== |
| |||
| Enrique A wrote: > I want to convert to upper case the first letter of all the words in a text > document, how can I do that with vi ? > > do I do something like this : > > :1,$s/ ^[a-z]/ ^[A-Z]/g > ^ ^ > blank blank > space space If you're willing to use vim rather than vi, see if this thread helps: http://groups.google.com/group/comp....3ec94bc16cc9e9 |
| |||
| Enrique A wrote: > > I want to convert to upper case the first letter of all the words in a text > document, how can I do that with vi ? > > do I do something like this : > > :1,$s/ ^[a-z]/ ^[A-Z]/g > ^ ^ > blank blank > space space > > Thanks I have found this to work: 1,$s/.*/\L&/ <- Make everything lower case g/[a-z][a-z]*/s//\u&/g <- Make every first letter in string of letters upper case. g/"[A-Z][a-z]"/s//\U&/g <- Correct two letter state abbreviations to all uppercase ("," delimited file) -- Steve Fabac S.M. Fabac & Associates 816/765-1670 |
| ||||
| "Steve M. Fabac, Jr." <smfabac@att.net> wrote in message news:43C9306E.E6FDD4C2@att.net... > Enrique A wrote: >> >> I want to convert to upper case the first letter of all the words in a >> text >> document, how can I do that with vi ? >> >> do I do something like this : >> >> :1,$s/ ^[a-z]/ ^[A-Z]/g >> ^ ^ >> blank blank >> space space >> >> Thanks > > I have found this to work: > > 1,$s/.*/\L&/ <- Make everything lower case > g/[a-z][a-z]*/s//\u&/g <- Make every first letter in string of letters > upper case. > g/"[A-Z][a-z]"/s//\U&/g <- Correct two letter state abbreviations to > all uppercase ("," delimited file) > > -- > > Steve Fabac > S.M. Fabac & Associates > 816/765-1670 > Awesome! It works great!. Thanks so much! |