title: Python - plot from txt file, skipping lines
body: <p>I have a problem with my script. I have (blabla.)txt file, for example:</p>
  
  <pre><code>blablaba bla
  dsadsadsa
  dsadsadsa
  50 2323
  60 2839
  70 9832
  80 0000
  .....
  ....
  ...
  </code></pre>
  
  <p>and script I wrote:    </p>
  
  <pre><code>import numpy as np
  import matplotlib.pyplot as plt
  
  with open("blabla.txt") as f:
      for line in xrange(3):
          next(f)
      for line in f:
  
        data = f.read()
  
        data = data.split('\n')
  
        x = [row.split()[0] for row in data]
        y = [row.split()[1] for row in data]
  
        index = [i for i,val in enumerate(x)]
  
        fig = plt.figure()
        ax1 = fig.add_subplot(111)
        ax1.set_title("graph")    
        ax1.set_xlabel('time')
        ax1.set_ylabel('distance')
        ax1.set_xticklabels(x)
        ax1.plot(index ,y, c='r', label='distance1')
        leg = ax1.legend()
        plt.locator_params(nbins=len(index)-1)
        plt.show()
  </code></pre>
  
  <p>The first question is: Is it true (syntax in the script) when I want to skip (because of the graph) the first three lines in the txt file?</p>
  
  <p>The second: After runscript it says:</p>
  
  <pre><code>data = f.read()
  ValueError: Mixing iteration and read methods would lose data.
  </code></pre>
  
  <p>What is the problem, its because of size?
  (txt file has about 600 000 lines)</p>
  
  <p>Thanks for all the help....Funstorm60</p>