This question already has an answer here:
How do I keep only the first 1000 occurrences of a words in a very long text and discard everything behind.
For example:
Sentence 1[ss]Sentence 2[ss]Sentence 3[ss]Sentence 4[ss]...Sentence 999[ss]Sentence 1000[ss]Sentence 1001[ss]Sentence 1002[ss]
Note: [ss] is my self-defined separator.
I would like to keep Sentence 1[ss]Sentence 2[ss]...Sentence 1000[ss]
. In other words, I would like to keep EVERYTHING (including the [ss]) until the Sentence 1000[ss]
and discard everything behind Sentence 1000[ss]
.
</div>