First off, please use [code] tags around your code samples in the future; the forum software does not retain the code indentation, and without the formatting the code is almost unreadable.
Second, the data you posted isn't in Comma-Separated-Values (CSV) format, but in a space-separated format. This doesn't seem to be a problem with the code, but it is a bit confusing to those of us reading this and expecting commas. Your code is written to work with a CSV file, so presumably, the actual file is in fact a CSV file.
Third, why did you have a series of separately declared strings (value1, value2, etc.) rather than an array, a structure, or a collection object? Again, it isn't a problem with the program per se, but it seems like a poor design, especially when you later use a list object and thus presumably know how to use collections.
Fourth, you are using a global variable for said list, which is generally considered a poor approach. While this appears to be something of a throw-away program - frankly, I would have used Perl or something like that for a small thing like this - it's still good practice to avoid globals.
Fifth, the list is set to contain objects of type FileInfo , but that class or structure isn't defined anywhere in the given code.
Sixth, you never delete the allocated FileInfo objects. Again, it shouldn't affect the program too much, but it's sloppy coding.
Finally, as for the problem you are having (I was going to get to it eventually, yes), it is occurring because there is a final, empty line in the data file, which - because file.good() is still true - the program tries to read, but gets a fail result back on the first getline() . Because it has already gone into a failed state, the later getline() calls in that loop iteration simply don't get run, leaving the numbers from the previous iteration in them.