Path: utzoo!utgpu!watserv1!watmath!att!bellcore!rutgers!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!swrinde!dfsun1!jackson From: jackson@dfsun1.electro.swri.edu (Keith Jackson) Newsgroups: comp.unix.questions Subject: Selective translation Message-ID: <1553@dfsun1.electro.swri.edu> Date: 10 Jul 90 20:26:38 GMT Reply-To: jackson@dfsun1.electro.swri.edu (Keith Jackson) Organization: Southwest Research Institute, San Antonio, Texas Lines: 23 I was trying to filter a file by making the first word lowercase and leaving the rest as is. My solution: % awk -f filt1.awk foo | tr A-Z a-z > stage1.b % pr -m -t -s -l1 stage1.a stage1.b > final where filt1.awk contains: { print $1; for (i = 2; i < NF; i++) printf("%s ", $i) >> "stage1.a"; if (NF > 1) print $NF >> "stage1.a"; } One flaw to this solution is that pr(1) ends up adding an extra line with the separation character (tab) on it. The question is, how does one do this more easily? -- -*^*-*^*-*^*-*^*-*^*-*^*-*^*-*^*-*^*-*^*-*^*-*^*-*^*-*^*-*^*-*^*-*^*-*^*- Keith Jackson {convex, texsun}!smu!jackson == jackson@csvax.seas.smu.edu == jackson@dfsun1.electro.swri.edu ## UN*X - live free or die ## Disclaimer: All views represented here are made by a person who doesn't plan ah