help with multiple save files, then load

hello, i want to be able to save info that will be typed, a persons name, address, and age in separate text files(example first text file: Jean smith, 22 mud road,19) then be able to read the files and give the information of each. A user should have the ability to pick a person they want to view the information of.

Problem is i am not sure how to approach this. I was thinking user enters name, save that name for the name of the save file and save input but how would you read the file to know which is the name address and age?

Thank you for your time
You could read everything in then map the name to the of the person to the "person" object or you could read in until you found the name. Then act accordingly with the persons information.
thanks for the reply but i am not sure how i would do that, what lib can i look into that will allow me to identify name? i am assuming from what your saying the saved text would have identifier like Name Jean Smith in the text to identify the name? that is what i was asking for actually and as i read didn't say so to well but again i am not sure how to go about doing so
Well I was just assuming you output them the same as you would input in a format of name address age. To do it the other way you could do XML way or w.e and parse something like <person>
<name>Gibby</name>
<address>Arizona</address>
<age>19</age>
</person>


Then when you find a <person> You would create a new Person and then you would read in (checking for name/address/age) until you found the closing delimiter of [/tt]</person>[/tt].


If you do the same format though you could simply do something like: in >> person.name >> person.address >> person.age;
Topic archived. No new replies allowed.