maxtektips8
Technical User
Hi,
With an input file like this
1,2,3,4,...,N
1,2,3,4,...,N
..
..
1,2,3,4,...,N
for N = 2 - a file with 2 columns only - using the following to calculate the sum of columns is okay :
{FS=","}
{s1+=$1;s2+=$2}
END{print s1 FS s2}
if N is big i suppose using an array would be more appropriate.
can anyone help ?
thanks
With an input file like this
1,2,3,4,...,N
1,2,3,4,...,N
..
..
1,2,3,4,...,N
for N = 2 - a file with 2 columns only - using the following to calculate the sum of columns is okay :
{FS=","}
{s1+=$1;s2+=$2}
END{print s1 FS s2}
if N is big i suppose using an array would be more appropriate.
can anyone help ?
thanks