Reading multiple columns of data with different data types

I am re-posting this question which was also posted last night, but I dont think I described my desired end state well enough. The code/class attached works very well at reading in a file with a single column of float data. However, i need it to read in columns of data with the format listed below;

318.47 November 01 2014
21.78 November 02 2014
0.00 November 03 2014

As you can see, the data in the input file is a float, then a character string, an integer and then another integer. However, I really dont care about the last three columns, I only want the first column. Unfortunately C++ tries to read across until the row comes to an end and then advances to the next line, so it tries to read the month, day and year, even though I dont want it to. is there any way I can force the code to read the 318.47 and then advance to the next line and continue to do this until the end of file is reached.

1
2
3
4
5
6
7
8
9
10
void Read_Columnar_File::Read_File(const std::string& file_name)
 int i;
 std::ifstream inp(file_name,std::ios::in|std::ios::binary);
 if(inp.is_open()) {
 std::istream_iterator<float> start((inp)), end;
 std::vector<float> values(start,end);
 for(i=0; i < 7; i++) std::cout << values[i] << std::endl;
 inp.close();
}
 else std::cout << "Cannot Open " << file_name << std::endl;
Also, while in this specific instance, I only want to read in the first column, how do i set this problem up if I do want to read all four columns. If I try;

std::vector<float> values(start,end) << vector<char> values2(start,end) << vector<int> values3(start,end) << ....

the code will not even compile, as I expected it would not. The point being is that if I do not use the vector format I know how to read in all four columns, but how do I do this with the vector format. the first question listed above is most near-term important to me, but if you can answer this second question with a code example, I would be very grateful.
Topic archived. No new replies allowed.