Remove text from file using C++?

I have a text file that has a title and numbers below. I wish to remove the word "Title" and only leave the numbers in the file. In addition, the existing code for calculating the average of these numbers is below. Can someone please include a modified code that will remove the title along with calculating the average as per the below?

Title
-533
-911
-121
-334
-546
791
-779
-28
509
795
465
220
612
-415
-141
-463
-243
67
-957
963
-35
-237
-315
-232
-430
210
557
506
-661
857
-917
585
978
-226
456
-803
-395
507
351
-589

#include <iostream>
#include <cmath>
#include <math.h>
#include <fstream>
#include <string>
#include <numeric>
using namespace std;

int main()
{
ifstream infile;
float num;
float total;
float x;
float aver;

x=0; total=0;
infile.open("gnumbers.csv");

while(!infile.eof())
{
infile>>num;
total=total+num;
x++;
}

aver=(total-num)/(x-1);

cout << "The last number in this range is: " <<num<< "\n";
cout<< "The sum of this range is: " <<(total-num)<<'\n';
cout<< "The number of items in this range is: "<<x-1<<'\n';
cout<< "The average of this range is: "<<aver<<'\n';
cout<< ""<<'\n';

infile.close();

getchar();
return 0;
}
Topic archived. No new replies allowed.