title: How to parse lines after a certain text in python
body: <p>I am trying to parse a text file. I need certain line of it only. I need to search for &quot;tool&gt; exit&quot;
  and parse all lines after that until 2nd last line. Here is the text I am trying to parse -</p>
  <pre><code>complete
  line:567       finish;
  tool&gt; exit
    Finish Failed  Myname
         0      0   ABC_dog_ctl
         5      1   ABC_cator_t
        34      0   ABC_cator_t
         0      0   ABC_cator_t
    Total = 12,  Failing = 4
    summary at 70s
  TOOL:   mytool
  </code></pre>
  <p>I am trying to parse only -</p>
  <pre><code>  Finish Failed  Myname
         0      0   ABC_dog_ctl
         5      1   ABC_cator_t
        34      0   ABC_cator_t
         0      0   ABC_cator_t
    Total = 12,  Failing = 4
    summary at 70s
  </code></pre>
  <p>I am trying something like -</p>
  <pre><code>my_list = []
  for line_no, line in enumerate(Infile):
      if &quot;tool&gt; exit&quot; in line:
          start_line = line_no
          my_list.append[line+1]
  
  </code></pre>
  <p>But I am not getting desired result. There are multiple instances of &quot;TOOL&quot; so I can't search it, but it's the last line so I think I can look for line above it always.</p>