On the program the "field_n" are replaced by the corresponding variable.
And I know that I need to process the strings in order to convert them into ints or floats. I haven't included that part.

So I'm making this post to see if anybody knows a better way to do what I'm trying to do, I'd appreciate any help. I'm also making this post because I think that using this I can achieve what I'm trying to do but I read on the other 3 topics regarding substrings that using substring on a loop is very inefficient, so again I'd take any suggestions. Lastly, my program doesn't recognize the str.substr command. I get the following error:

Thank you very much for your response tabstop. Its always 6 fields. I suppose they'll always be in the same order. What strings do u mean can have spaces? The storage strings or the initial strings from the input file? To answer my own question, both strings may have spaces.

Thanks for pointing out my error in your second statement . I'm going to try if it works. Will post results soon.

Again, thanks a million. :P

EDIT: Yea, works. Thanks. Still, if you can suggest a better way to do it I'm all ears because I really don't think the way I'm doing it is very good.

Having strings with spaces in them reduces your options considerably. At this point, you're pretty much stuck with searching through the string, looking for keywords (or at the least, looking for colons, with the part to the left being the key and the part to the right being the value).

K, thanks. I've been surfing a bit and I found that its a variant of the address book program and most of them are done with some sort of data container so I guess I'll stick to std::maps. Currently, I'm having a really difficult time understanding how iterators work. Do you think u can shed some light on them or know some good links with good explanations and examples?

Thanks for your reply. Can you elaborate a little bit? I'm having difficulties seeing how to apply that.. Remember that in each line there will be different strings and different number values that each have to go to a separate container. Thanks again.

>> with a stringstream (just like >> on any stream) will not pick up a string with spaces in it, nor for that matter will it know to stop on a colon character. (The last is not really a big issue, as that actually makes it a little bit easier to check which strings are your keys (they're the ones with colons at the end), but the first can be a large pain to deal with.)

Aight. The other day I read somewhere that you can store strings in arrays. -_-
I wasn't aware of that. So now I'm doing redoing the whole program combining arrays and maps. It will be much easier. Thanks folks for the help, I really appreciate it.