bis wrote:
#!/usr/bin/perl -p
s/(\s)(.)/$1\u$2/g if/SCTN:/;
This capitalises the first letter of every word in
the whole document.
No, it doesn't. Only the lines containing "SCTN:"
Have you run it?
yes i have run it and below is the kind of output i
get (original input all lower case except cap
--- zsdc <[EMAIL PROTECTED]> wrote: > *Please* CC the mailing
list when you answer. I'm
> writing it so everyone
> on the list could learn something, not just to fix
> your program or solve
> your particular problem.
>
thanks for the reminder zsdc - i should have
remembered to cc the list when
*Please* CC the mailing list when you answer. I'm writing it so everyone
on the list could learn something, not just to fix your program or solve
your particular problem.
bis wrote:
Tnaks zsdc and JEGII.
--- zsdc <[EMAIL PROTECTED]> wrote:
It gives a syntax error. Maybe try this:
#!/usr/b
On Saturday, August 23, 2003, at 02:34 AM, zsdc wrote:
s/(SCTN:\s*)(.+)$/join '', $1, map { ucfirst $_ } split /( )/, $2/ge;
See if that helps any.
It gives a syntax error. Maybe try this:
Sorry, I forgot to backwack those /. My fault for not testing the
code. I'll try again:
s{(SCTN:\s*)(.+)
James Edward Gray II wrote:
On Friday, August 22, 2003, at 05:06 PM, bis wrote:
Thanks Gabriel - your suggested code
s/(SCTN:\s*)(\w+)/$1\u$2\E/g;
[...]
Well, let's see if we can get a little closer:
s/(SCTN:\s*)(.+)$/join '', $1, map { ucfirst $_ } split /( )/, $2/ge;
See if that helps any.
On Friday, August 22, 2003, at 05:06 PM, bis wrote:
Thanks Gabriel - your suggested code
s/(SCTN:\s*)(\w+)/$1\u$2\E/g;
is an improvement - it does capitalise the first
letter - but only of the first word after "SCTN: " so
i get something like
SCTN: This is a section name
What I need is
SCTN:
Thanks Gabriel - your suggested code
s/(SCTN:\s*)(\w+)/$1\u$2\E/g;
is an improvement - it does capitalise the first
letter - but only of the first word after "SCTN: " so
i get something like
SCTN: This is a section name
What I need is
SCTN: This Is A Section Name
hope that makes sense! :)
Bis wrote:
>
> I want to make the case of the first letter of all the words in a
> selected string to upper case. The code
>
> s/\b(\w+)/\u$1\E/g;
>
> enables me to do this for the whole document.
>
> But the string I want to match and operate on is all instances of
> text following the string
Bis <[EMAIL PROTECTED]> wrote:
I want to make the case of the first letter of all the words in a
selected string to upper case. The code
s/\b(\w+)/\u$1\E/g;
enables me to do this for the whole document.
But the string I want to match and operate on is all instances of text
following the string
SC
Bis wrote:
I want to make the case of the first letter of all the words in a
selected string to upper case. The code
s/\b(\w+)/\u$1\E/g;
enables me to do this for the whole document.
But the string I want to match and operate on is all instances of text
following the string
SCTN:
as in
SCTN: N
10 matches
Mail list logo