I don't think you are going to find anything pre-written like that with getline or anything else. You want something that both reads in input AND searches for a string at the same time. I don't know of anything like that that exists, and I don't see anything like that with getline. I think you have to read in data, THEN check for the delimiter using "find" from string or something like that. In other words, two separate tasks. One, read in data from the stream. Two, check the stream to see whether you've gone far enough. Possibly step three: Check to see if you've gone "too far" and if so, adjust the string that holds what you've read in and possibly "put back" characters into the stream.
You should probably read a character at a time, then check whether "END" has appeared yet, then continue or stop based on that. There may be something pre-written out there (it comes up a lot, so there probably is), but if it's in the standard libraries, I don't know what it is (which doesn't mean it doesn't exist!).
Reputation Points: 2614
Solved Threads: 687
Posting Expert
Offline 5,375 posts
since Jan 2008