|
-
June 16th, 2011, 05:12 PM
#1
Searching an input .txt file for a key string
Hey everyone,
I am creating an application to output many small text files from a large input text file. I am familiar with the getline function. What I usually do is put an entire line (from the .txt file) into a string (call it string_a), and then use a pointer to find the key character of the line I need to detect. After that, I write any proceeding text to an output .txt file.
Here is my question:
What if I am looking for more than just a single key character to trigger my program to start writing to the output file? Let's say I want to look for a key phrase. Let's say string_a contained the following text:
Ro, Key: 480000030 Name:AvTech, Id:20, Trip Offset:859500
I want to write the information after 'Name:' to my output file. Is there an effective way to search a large .txt file for the string 'Name:' ?
Thanks in advance.
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
|