Re: Lower casing letters of words
- From: laredotornado@xxxxxxxxxxx
- Date: 18 Jul 2005 11:32:11 -0700
Hello, Thanks for your response. Was this meant to go in a script? I
created a script
#!/bin/ksh
while read -C -a array; do
array[3]=`echo ${array[2]} | perl -pi -e 's/(\w+)/\u\L$1/g'
myfile.txt`
array[4]=`echo ${array[4]} | perl -pi -e 's/(\w+)/\u\L$1/g'
myfile.txt`
array[5]=`echo ${array[5]} | perl -pi -e 's/(\w+)/\u\L$1/g'
myfile.txt`
echo "${array[*]|,,}"
done
Then I ran
../temp.sh
but got the error
../temp.sh[3]: read: bad option(s)
What am I doing incorrectly? Thanks, - Dave
Paul Lalli wrote:
> Paul Lalli wrote:
> > laredotornado@xxxxxxxxxxx wrote:
> > > Hello,
> > > Is there a simple perl command line expression I can write that will
> > > take
> > >
> > > "CORDOVA SCHOOL DISTRICT"
> > >
> > > and make it
> > >
> > > "Cordova School District"
> >
> > s/(\w+)/\u\L$1/g;
>
> Bah. Should have checked the Perl FAQ before posting. Of course, so
> should the OP...
>
> perldoc -q capitalize
> shows that this solution is sub-optimal at best, and recommends a
> slightly longer alternative. I recommend you use the one suggested
> there.
>
> > Paul Lalli
.
- Follow-Ups:
- Re: Lower casing letters of words
- From: RedGrittyBrick
- Re: Lower casing letters of words
- References:
- Lower casing letters of words
- From: laredotornado
- Re: Lower casing letters of words
- From: Paul Lalli
- Re: Lower casing letters of words
- From: Paul Lalli
- Lower casing letters of words
- Prev by Date: Re: copy contructor
- Next by Date: Re: Extract until unquote or EOL
- Previous by thread: Re: Lower casing letters of words
- Next by thread: Re: Lower casing letters of words
- Index(es):
Relevant Pages
|