Path: utzoo!mnetor!uunet!husc6!cmcl2!nrl-cmf!ames!ucsd!sdcsvax!ucsdhub!hp-sdd!hplabs!hpda!hpcupt1!hpsal2!morrell From: morrell@hpsal2.HP.COM (Michael Morrell) Newsgroups: comp.unix.questions Subject: Re: ATTN: AWK GURUS!!! (lower to upper conversion) Message-ID: <2450004@hpsal2.HP.COM> Date: 23 Mar 88 19:28:51 GMT References: <16782@beta.UUCP> Organization: HP System Architecture Lab, Cupertino Lines: 18 This is a little less gross, I hope (and it also seems to work). BEGIN { lower="abcdefghijklmnopqrstuvwxyz" upper="ABCDEFGHIJKLMNOPQRSTUVWXYZ" } { new = "" for (i=1; i <= length; ++i) { cur = substr($0, i, 1) j = index(lower, cur) if (j != 0) new = new substr(upper, j, 1) else new = new cur } print new }