adding up field columns in a file
- From: cconnell_1@xxxxxxxxx
- Date: 23 Jan 2006 00:37:47 -0800
Hello,
I have a file with some columns of numeric data e.g.
5 5
5 6
5 7
I need to total them, currently im using the following method
for i in cat <filename> | awk print column2 (for example)
do
total=$i
total=èxpr $total + $i`
done
However this method is really slow on large files, could someone
recommend a quicker way?
Thanks
.
- Follow-Ups:
- Re: adding up field columns in a file
- From: Xicheng
- Re: adding up field columns in a file
- From: Randal L. Schwartz
- Re: adding up field columns in a file
- From: Chris F.A. Johnson
- Re: adding up field columns in a file
- Prev by Date: Top 10 subjects comp.unix.admin
- Next by Date: Re: adding up field columns in a file
- Previous by thread: input output on a particular directory
- Next by thread: Re: adding up field columns in a file
- Index(es):
Relevant Pages
|