Xref: utzoo comp.unix.wizards:7261 comp.unix.questions:6167 Path: utzoo!mnetor!uunet!husc6!tut.cis.ohio-state.edu!bloom-beacon!bu-cs!bzs From: bzs@bu-cs.BU.EDU (Barry Shein) Newsgroups: comp.unix.wizards,comp.unix.questions Subject: Re: ATTN: AWK GURUS!!! (lower to upper conversion) Message-ID: <20805@bu-cs.BU.EDU> Date: 22 Mar 88 06:58:55 GMT References: <16782@beta.UUCP> Organization: Boston U. Comp. Sci. Lines: 21 In-reply-to: dph@beta.UUCP's message of 21 Mar 88 19:31:51 GMT > Convert possibly mixed-case strings to upper-case. > (not counting case-less chars like digits) The attached works under 4.3bsd as you required. -Barry Shein, Boston University BEGIN { upper = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; lower = "abcdefghijklmnopqrstuvwxyz"; } { out = ""; for(i=1;i <= length($1);i++) { if((cpos = index(lower,c = substr($1,i,1))) > 0) c = substr(upper,cpos,1); out = out c; } print out; }