Loop thru a list and stop when the first string is found
<p>I have a list and I want to extract to another list the data that exist between top_row and bottom_row.
I know the top_row and also that the bottom_row corresponds to data[0] = last integer data (next row is made of strings, but there are also rows with integers which I'm not interested).</p>

<p>I've tried several things, but w/o success:</p>

<pre><code>for row,data in enumerate(fileData):
    if row &gt; row_elements: #top_row
        try:
            n = int(data[0])
            aux = True
        except:
            n = 0
        while aux: #until it finds the bottom_row
            elements.append(data)
</code></pre>

<p>The problem is that it never iterates the second row, if I replace while with if I get all rows which the first column is an integer.</p>

<p>fileData is like:</p>

<pre><code>*Element, type=B31H
  1,   1,   2
  2,   2,   3
  .
  .
  .
 359, 374, 375
 360, 375, 376
*Elset, elset=PART-1-1_LEDGER-1-LIN-1-2-RAD-2__PICKEDSET2, generate
</code></pre>

<p>I'm only interested in rows with first column values equal to 1 to 360.</p>

<p>Many thanks!</p>
