I'm trying to parse a fairly complicated, but structured file using c++.
011 FistName MiddleName LastName age(int) date(4/6/2001) position status ...
012 FistName MiddleName LastName age(int) date(4/6/2001) position status ...
...
That's what the file format looks like. I'm trying to store the data as individual field of a struct but the first middle last name are of variable size and may not have the middle name in them, so how would you distinguish that?
For example,
014 Jon Smith ...
015 Jon J Smith, Jr. ...
I want to store the whole name in a name field rather than separate them. Say we have
struct{
std::string name;
int id;
int age;
std::string position;
...
}
How would i go about parsing everything?