Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

8
  • This and @Toby Speight's answer might both need something like && !/^$/ or && $0 == "" added to the !/Success/ test to avoid printing the empty line (which isn't in the OP's sample output, but their description of what they want suggests that they want everything between the 2nd and 3rd Success. It's ambiguous). Or use length() as you suggested. Commented Oct 29 at 16:24
  • That works! What could I do to let it print e.g. from the n-th Success to (n+x)-th Success, where x is a positive integer? I thought about capturing every x prints and composing them, but there must be an easier approach? Commented Oct 29 at 23:12
  • You should accept an answer to the question you asked and which we all answered and then ask a new question if you need help with that, otherwise this becomes a Chameleon Question which is strongly discouraged in this forum. Commented Oct 30 at 2:43
  • 1
    @EdMorton I just did it. Because I wasn't able to upvote yet, I thought marking solutions wasn't possible either. Commented Oct 31 at 0:21
  • 1
    @l0b0 it is indeed, I’ve added that to the post. Commented Oct 31 at 14:53