|
-
January 17th, 2010, 09:25 AM
#1
Searching a string for information
Hey guys, im quite new to c++. i am doing a project in which i would have to extract certain information of a database which i have saved in a text file. the database looks something like this :
Database
John32451^23.21 >tyyhg>tdsrte^>1.24
Mark55342^ 335.11 >tsthh
What i am trying to do is search each row based on a specific id and then extract the information next to it. For example, if i were to select John in the menu, the output will be like this.
OUTPUT
John 23.21 1.24
I am not very sure how could i do this and the method to use. Could i get some guidance? To get the correct line will be easy as we just have to search for the name to get the line. But , how about the other two information? I was thinking of using the characters before it which is "32451^" and then reading the info. but how do i get it to stop at the information i want and not continue displaying the information after that which is ";gt;t"
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|