title: Built in Python function to skip row of data
body: <p>I have a script that reads in a large data file 3GB I don't need all of the data and would like to skip particular rows of data if a condition is meet. Is there a Python function to skip a row of data in a data file and continue reading the file? I checked the 3.2 docs but only found a function that skips chunks of data.</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>reading in data like this </p>
  
  <pre><code>def read_file(F):      #Function that reads data froma file  
                     #and extracts specific data columns
  X = []
  Y = []                # Creats Data Lists
  Z = []
  
  
  N =   11912639  # number of lines to be read
  f = open(F)           #Opens file
  f.readline()          # Strips Header
  nlines = islice(f, N) #slices file to only read N lines
  
  
  for line in nlines:             #Loop Strips empty lines as well as replaces tabs with   space
      if line !='':
          line = line.strip()
          line = line.replace('\t',' ')
          columns = line.split()
          x = columns[0]             # assigns variable to columns
          y = columns[1]
          z = columns[2]
          X.append(x)
          Y.append(y)                #appends data in list
          Z.append(z)
  </code></pre>
  
  <p>What I was thinking of doing is putting an if statement in the above code something like</p>
  
  <pre><code>if x &gt; somevalue:
      skipline
  else:
      continue 
  </code></pre>