It depends on how the text file is formatted. At first glance this looks like a fixed-width layout. You could read each line into a structure which you define, or read each line a portion at a time, specifying the length to read. That can get a bit messy, but a lot of the code is repetitive so once you start, it gets easier.
On the other hand, it looks as though this text is separated into individual fields using the tab character '\t'. In this case, things are probably easier. You can use the
getline()
function with '\t' as the delimiter, and read each field into a string, and use a suitable function such as atoi() or atof() to convert to numeric. Or something along those lines, more than one possibility.
As for storing the result in an array, I'd suggest you define a suitable structure, such as this:
1 2 3 4 5 6 7 8 9 10
|
struct item {
int num1;
string name;
char letter;
double num2;
int num3;
double num4;
double num5;
double num6;
};
|
Then you just need an array of such items to hold the resulting data.