Ok. Thanks again. I think I've found what I need.
(on lines of 'inpch' that contain 'TH' I change the field at position
$pos to be $new, preserving spacing made of 'space's and/or tabs).
If anyone comes up with sth. simpler...

Ruda

(The script is for 'rc', btw., so that the concatanation on the 3rd line work.)

        9 awk '
                /TH/ {n = split($0, spaces, /[^         ]+/);
                        $'$pos'='$new';
                        line = "";
                        for(i = 1; i < n; i++)
                                line = line spaces[i] $(i);
                        line = line spaces[n];
                        print line;
                        next;}
                {print}
                ' inpch

Reply via email to