Re: upper/lower case

"'Ruud H.G. van Tol' [email protected] [sed-users]" <[email protected]>
Newsgroups gmane.editors.sed.user
Message-ID <[email protected]>
Perl-variant that skips line 1:

perl -aF\; -pe'$F[2*($.>1)]=~s/(\w+)/\u\L$1/g;$_=join";",@F' input.txt


Clearer, commented version:

perl -aF\; -pe ' # split each line on \;
   next if $. == 1; # skip line 1
   s/(\w+)/\u\L$1/g for $F[2]; # tcase(lcase) each word of field2
   $_ = join ";", @F; # glue all fields back together again
' input.txt

-- Ruud


For debugging, try: s/(\w+)/[$1->\u\L$1]/g
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.