Just for clairfication I'm using c++ so C looks a bit different to me but I'm sure I can figure it out.
and under "cbl" is the cable numbers (none are going to be integers all are strings).
Clarify this statement. You say none are going to be integers, yet your example text contains only integers. When it comes to string parsing, the details are essential.
Everything in my txt right now are going to be used as strings. Even though it looks like a number, I am only worried about passing it as strings of txt for now. I'll soon be searching txt for numerical values and sorting them for other purposes but right now I'm going step by step trying to get string positions and minuplation.
Where I'm at now is a bit confusing. For example. I'm unsure how to get to the line under the "cbl" and to stop once it gets to another remote number.
if (mystring.find ("r=") != string::npos){
rString_pos = mystring.npos + 2;
rname = mystring.substr(rString_pos+1, 4);
cout <<rname<<endl;
}
The above finds the string "r=" and moves the npos to the character afterwards then I put the remaining line into rname.
But I can't do the same for cbl. Even the above seems wrong or around-the-way (but it works). I'm thinking of using a while loop but i'm unsure how to write the correct loop with the right paramerters to look for. I tried getline() but that doesn't work because I don't know how to get the string from the line into my string and to continue until it reaches another keyword.