Jan 31, 2007 #1 Yarka Technical User Jan 14, 2007 192 ES Hi, How can I add a column of numbers? Thanks.
Jan 31, 2007 1 #2 PHV MIS Nov 8, 2002 53,708 FR Any chance you could explain what you want to do ? Hope This Helps, PH. Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886 Upvote 0 Downvote
Any chance you could explain what you want to do ? Hope This Helps, PH. Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
Jan 31, 2007 Thread starter #3 Yarka Technical User Jan 14, 2007 192 ES I've several files. Each file is formed by a column. I want to add the columns of each file. Upvote 0 Downvote
Jan 31, 2007 #4 PHV MIS Nov 8, 2002 53,708 FR If you want a column with line number: pr -tn -e /path/to/input or: awk '{printf "%5d %s\n",NR,$0}' /path/to/input Hope This Helps, PH. Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886 Upvote 0 Downvote
If you want a column with line number: pr -tn -e /path/to/input or: awk '{printf "%5d %s\n",NR,$0}' /path/to/input Hope This Helps, PH. Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
Jan 31, 2007 Thread starter #5 Yarka Technical User Jan 14, 2007 192 ES Hi, I want to add a column. For exemple, if my file have: 0,0001 0,0002 0,0004 0,0009 0,0001 I want to obtain the value: 0,0017 Thanks. Upvote 0 Downvote
Hi, I want to add a column. For exemple, if my file have: 0,0001 0,0002 0,0004 0,0009 0,0001 I want to obtain the value: 0,0017 Thanks.
Jan 31, 2007 #6 PHV MIS Nov 8, 2002 53,708 FR Something like this ? awk '{t+=$1}END{print t}' /path/to/input Hope This Helps, PH. Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886 Upvote 0 Downvote
Something like this ? awk '{t+=$1}END{print t}' /path/to/input Hope This Helps, PH. Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886