How to sum up each column of matrices

HI,

Pardon me I'm not very good in looping programs and still learning every now and then....:(

Assuming I have a N rows by 3 columns matrix.

I have these data stored in a text file initially.

Now I wish to extract these data from the text file and perform further mathematical operations.

My main concern:

1. How to Extract the 3 columns from the text file in order to proceed to the 2nd step:

2. How do I sum up each column?? :confused:

I really appreciate if anyone can help me ...

Performing Mathematical operations On a Txt file from C++ Program

Hi,

I'm wondering if it's possible to perform mathematical operations, i.e. addition, on a txt file via my C++ Program?:(

As related to my previous thread, I have to write the compiled data (in C++) into txt file format and then to retrieve this txt file later for further use.

All I can think of is the use of:

... while (!filepointer4.eof ())

{

double vector[3];

....filepointer << vector[0] << vector[1] << vector[2];

....

I know this loop will extract the data I need from that particular file.

I'm really confused on how to sum up all data i.e. I want something like :

X = sumation of vector[0] from entire txt file

Y = sumation of vector[1] from entire txt file

Z = sumation of vector[2] from entire txt file

Please Help me .... :(

-----------------------------------------------------------------------------------

P.S. I appreciate all replies on my previous thread. Thank you.:(