|
I really appreciate the help.
I like the xargs thing. Is it then possible to add each element in a column and divide it by the numbers of elements in the column.
I've used this command:
awk '{ sum+=$1/2 }{ sum1+=$2/2} END { print sum sum1 }'
But $1/2 where the 2 should be a variable (the number of elements in the column).
Also ranj@chn I didn't get your script to work, I must be doing something wrong. I just copied what you wrote and tried to run it with:
awk -v var=2 -f reader2.awk testfile.txt
But I only get errors.
And I also tried to run ahmedwaseem2000's program but I didn't get that to work either. I really sorry but I'm a real "noob" at this. But the help you are giving me are invaluable.
|