Lower->Upper in AWK (was: Re: cascading pipes in awk)
Randal L. Schwartz
merlyn at agora.UUCP
Mon May 29 07:47:10 AEST 1989
In article <13921 at lanl.gov> dph at lanl.gov (David Huelsbeck) writes:
| From article <818 at manta.NOSC.MIL>, by psm at manta.NOSC.MIL (Scot Mcintosh):
| >
| > Unfortunately, I only want to uppercase a few selected portions of the
| > text my awk program is reading (my original posting contained a
| > very simplified example, so this wasn't obvious). There just doesn't
| > seem to be a way to have a filter program in the middle of two groups
| > of awk statements.
|
| I afraid your right. Perhaps nawk or gawk would help you but I
| really don't know enough about either one to say. However, you
| can, somewhat painfully, translate lower to upper or rot13 or
| whatever in plain old awk.
|
| Here is my solution to this problem along with a summary of solutions
| I recieved from other awkers when I posted asking for a better way.
| Sorry for the length but I felt that every different solution showed
| a unique and interesting approach that might be useful in solving other
| sorts of problems in awk.
[solution deleted]
Just get Perl. It is great for this, and best of all, it's free!
For example, to make variable "$foo" uppercase:
$foo =~ tr/a-z/A-Z/;
Just another Perl hacker (thanks Larry!)...
-- Randal L. Schwartz, Stonehenge Consulting Services (503)777-0095
quality software, documentation, and training at affordable rates
<merlyn at agora.hf.intel.com> ...!uunet!agora.hf.intel.com!merlyn
More information about the Comp.unix.questions
mailing list