title: Line counts in Python
body: <p>I have an input file contains data as:</p>
  
  <pre><code>0.0  0.000  0.0000  0.000   0.000
  0.1  0.000  0.0000  0.000   0.000
  0.2  0.000  0.0000  0.000   0.000
  0.3  0.000  0.0000  0.000   0.000
  0.4  1.7637  232323  23232  234242
  0.65  21344   2134214  412412 214124
  0.55  23423   32423    32423  32423
  </code></pre>
  
  <p>I need to add contents after last row which contains zeros only.which means a row after 0.3 is to be added.
  I need my output as</p>
  
  <pre><code>  0.0  0.000  0.0000  0.000   0.000
    0.1  0.000  0.0000  0.000   0.000
    0.2  0.000  0.0000  0.000   0.000
    0.3  0.000  0.0000  0.000   0.000
    0.4  0.000  0.0000  0.000   0.000
    0.5  1.7637  232323  23232  234242
    0.75  21344   2134214  412412 214124
    0.65  23423   32423    32423  32423
  </code></pre>
  
  <p>Please help me with a code to reach my required output.
  What I have tried is:</p>
  
  <pre><code>for line in f1:
    string=line
    if rthcount&lt;=6:
       strplit=string.split()
       rign=strplit[1]
       if rign==0.0:
           print(string)
     else:
         f4.write(string)
     rthcount+=1
  </code></pre>
  
  <p>Please help me with a code to work this.</p>