From owner-freebsd-questions Sun Mar 26 14: 7:16 2000 Delivered-To: freebsd-questions@freebsd.org Received: from dt051n0b.san.rr.com (dt051n0b.san.rr.com [204.210.32.11]) by hub.freebsd.org (Postfix) with ESMTP id B0E7A37BAB7 for ; Sun, 26 Mar 2000 14:07:13 -0800 (PST) (envelope-from Doug@gorean.org) Received: from gorean.org (doug@master [10.0.0.2]) by dt051n0b.san.rr.com (8.9.3/8.9.3) with ESMTP id OAA14690; Sun, 26 Mar 2000 14:07:11 -0800 (PST) (envelope-from Doug@gorean.org) Message-ID: <38DE8A0F.8CD9EF36@gorean.org> Date: Sun, 26 Mar 2000 14:07:11 -0800 From: Doug Barton Organization: Triborough Bridge & Tunnel Authority X-Mailer: Mozilla 4.72 [en] (X11; U; FreeBSD 5.0-CURRENT-0322 i386) X-Accept-Language: en MIME-Version: 1.0 To: Greg Pavelcak Cc: freebsd-questions@FreeBSD.org Subject: Re: A "title case" script References: <20000326125654.A77405@oitunix.oit.umass.edu> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Greg Pavelcak wrote: > > When I get information from the University database, it's all > caps. Usually we use this info for mass mailings, so we want > proper capitalization. MSWord's "title case" feature gets it > almost right. I was wondering if anyone has an awk or perl or > something script that can do this job. > > I know about awk's toupper() and tolower(), but I haven't gotten > it to work right yet. Does it have to be awk? Assuming that what you want is the first letter capitalized, you can just do, $string = ucfirst lc $string; Good luck, Doug -- "So, the cows were part of a dream that dreamed itself into existence? Is that possible?" asked the student incredulously. The master simply replied, "Mu." To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message