Re: upper/lower case

"Daniel Goldman [email protected] [sed-users]" <[email protected]>
Newsgroups gmane.editors.sed.user
Message-ID <[email protected]>
That is quite a feat you did! Of course, now it's very obscure, a huge 
negative, probably about as obscure as the perl solution. But at least 
you did it. The parameter-driven while-loop script would have to be 
fixed up not to operate on the first line, but I'm sure that could be 
done (I'm not suggesting you do it!). Anyway, as usual, there are 
several ways to do something, with advantages and disadvantages.

Daniel

On 12/12/2015 11:00 AM, [sed-users] wrote:
> Of course the while-loop script can also be made parameter driven:
>
>
>   #!/bin/sh -u
>
>
>   c=3;   # column to sed
>   d=\;;   # csv delimiter
>
>
>   lc_code="$c!b;s/.*/\L&/;s/\<[a-z]/\u&/g";    # sed code to lowercase
>   pr_code="H;1h;\$!d;g;y/\\n/$d/";                # sed code to print line
>
>
>   while IFS= read -r Line; do
>      set -f;
>      IFS=$d; set X $Line; shift;
>      set X $(printf '%s\n' "$@" | sed -e "$lc_code"); shift;
>      echo "$@" | sed -e "$pr_code";
>   done < input.txt
>
>
>
>   HTH
>
>
>   -Rakesh
>
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.