There are a couple of other methods you could use if you want to stick to [text search] (you might want to do this because it allows for more flexible use).
First method: As soon as you find a match, delete it and then repeat the search. Of course this destroys your database, so you'll have to reload it once the whole search is finished. Not very efficient, but it's fairly easy to implement.
Second method: If you can afford to alter the text file a bit, then prepend a line number for each line. Then search for it like this:
Basically, you're searching for a number "2" in the 1st term with a line-number greater than 0 ( in the 0th term) . If a match is find at line x, you search again for a the number "2" with a line-number greater than x+1. The process terminates when no more matches are found ([sel -1]).