Selective translation

Keith Jackson jackson at dfsun1.electro.swri.edu
Wed Jul 11 06:26:38 AEST 1990


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 at csvax.seas.smu.edu
== jackson at 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



More information about the Comp.unix.questions mailing list