title: how to extract text between two delimiters when string is present
body: <p>I have a large data file which looks like:</p>
  
  <pre><code>//
  ID   1.1.1.258
  DE   6-hydroxyhexanoate dehydrogenase.
  CA   6-hydroxyhexanoate + NAD(+) = 6-oxohexanoate + NADH.
  CC   -!- Involved in the cyclohexanol degradation pathway in Acinetobacter
  CC       NCIB 9871.
  //
  ID   1.1.1.259
  DE   3-hydroxypimeloyl-CoA dehydrogenase.
  CA   3-hydroxypimeloyl-CoA + NAD(+) = 3-oxopimeloyl-CoA + NADH.
  CC   -!- Involved in the anaerobic pathway of benzoate degradation in
  CC       bacteria.
  //
  ID   1.1.1.260
  DE   Sulcatone reductase.
  CA   Sulcatol + NAD(+) = sulcatone + NADH.
  CC   -!- Studies on the effects of growth-stage and nutrient supply on the
  CC       stereochemistry of sulcatone reduction in Clostridia pasteurianum,
  CC       C.tyrobutyricum and Lactobacillus brevis suggest that there may be at
  CC       least two sulcatone reductases with different stereospecificities.
  //
  </code></pre>
  
  <p>I want to extract sections of this file that contain the work <code>anaerobic</code> . I specifically want the ID line. </p>
  
  <p>Is there a means to search the file between ID and // to find <code>anaerobic</code>and print the output to a new file? If the whole section is printed that is fine as I figure I can grep it out after. </p>
  
  <p>Expected out should be either</p>
  
  <pre><code>ID   1.1.1.259
  </code></pre>
  
  <p>or </p>
  
  <pre><code>ID   1.1.1.259
  DE   3-hydroxypimeloyl-CoA dehydrogenase.
  CA   3-hydroxypimeloyl-CoA + NAD(+) = 3-oxopimeloyl-CoA + NADH.
  CC   -!- Involved in the anaerobic pathway of benzoate degradation in
  CC       bacteria.
  //
  </code></pre>