title: Grab nth occurrence in between two patterns using awk or sed
body: <p>I have an issue where I want to parse through the output from a file and I want to grab the nth occurrence of text in between two patterns preferably using awk or sed</p>
  
  <pre><code>category
  1
  s
  t
  done
  category
  2
  n
  d
  done
  category
  3
  r
  d
  done
  category
  4
  t
  h
  done
  </code></pre>
  
  <p>Let's just say for this example I want to grab the third occurrence of text in between category and done, essentially the output would be</p>
  
  <pre><code>category
  3
  r
  d
  done
  </code></pre>