I want to parse a tab delimited file using Boost.Spirit (Qi). My file looks something like this:
John Doe\tAge 23\tMember
Jane Doe\tAge 25\tMember
...
Is it possible to parse this with a skip parser? The problem I have right now is, that boost::spirit::ascii:space
also skips the whitespace within the name of the person. How would the phrase_parse(...)
call look like?
I am also using the Boost.Fusion tuples for convient storing of the results in a struct:
struct Person
{
string name;
int age;
string status;
};
This seems to work for the name
:
String %= lexeme[+(char_-'\t')];
It matches everything char that is not a tab. It is then used as part of the bigger rule:
Start %= Name >> Age >> Status;