I have a file containing lines of the form,
double mass, string seq, int K, int TS, int M, [variable number of ints]
688.83 AFTDSK 1 1 0 3384 2399 1200
790.00 MDSSTK 1 3 1 342 2
I need a (preferably simple) way of parsing this file without boost. If the number of values per line had been constant then I would have used the solution here.
Each line will become an object of class Peptide:
class Peptide {
public:
double mass;
string sequence;
int numK;
int numPTS;
int numM;
set<int> parents;
}
The first three integers have specific variable names in the object while all the following integers need to be inserted into a set.
I was fortunate enough to get two really awesome responses but the run time differences made the C implementation the best answer for me.