READ AND EXTRACT VALUES FROM A .DAT FILE

I have to make a program using c++ that open and read a file .dat in which there are a lot of lines organized in different columns, like these:

0.000000 -9.904166 22.413387 1.000000 0.083073
5.000000 -9.899996 22.414845 1.000000 0.083184
10.000000 -9.903506 22.413485 1.000000 0.083142

Once open and read, i have to extraxt, line by line, only the second and fifth column and calculate the mean and standard deviation.

So, somebody has an idea about how to realize this program with c++?
How can i make a reference to column i need?

THANK YOU
Topic archived. No new replies allowed.