If it only contains parts enclosed in brackets, you could use a while loop with char = ] as the end condition. That way you don't even need to start with [. Just use the while loop to load the chars into an array or string (or vector if you can't predict the size beforehand).
Yeah that would work....then I could take the vector and use strstr to find the beginning of the character array right?
Actually, this is good....Ive never used vectors, but I think I understand them (and Ill never learn about them without trying em out). So I could take a vector and load it up one character at a time with the entire sector output. Then strstr through the vector looking for the matching galactic coordinates. If it finds them, then another strstr through the vector again looking for the beginning of each of the ten size 1500 character arrays that make up each sector.
The complications are thus....
The output to the sectors text file looks like this....
<123412341>
[...extrememly long char arrays...]
[...extrememly long char arrays...]
[...extrememly long char arrays...]
[...extrememly long char arrays...]
[...extrememly long char arrays...]
[...extrememly long char arrays...]
[...extrememly long char arrays...]
[...extrememly long char arrays...]
[...extrememly long char arrays...]
[...extrememly long char arrays...]
Now multiply that by several dozen, hundred, or even thousand. Thats what the sectors.txt file looks like after some exploring. I want the vector to leave out the '[', ']', '<' and '>'s. I want to strstr just for the nine digits of the galactic coordinates, then load the sector structure with the character arrays one at a time for each of the ten z-levels in a sector (by searching for '[' characters).
As you can see this is a very tedious process. Im sure theres got to be a better way. Maybe I could do it without the deleniating characters? Thats how I was doing it before actually. But that causes more handholding during the search for the right inputs.
My brain hurts now.