title: How to skip 2 lines in a file with Python?
body: <p>I have a series of files and I want to extract a specific number from each of them.
  In each of the files I have this line:</p>
  
  <pre><code>name, registration num
  </code></pre>
  
  <p>and exactly two lines after that there is the registration number. I would like to extract this number from each file. and put it as a value of a dictionary.Anyone have any idea how it is possible ?</p>
  
  <p>my current code that does not actually work is like below:</p>
  
  <pre><code>matches=[]
  for root, dirnames, filenames in os.walk('D:/Dataset2'):  
      for filename in fnmatch.filter(filenames, '*.txt'):   
          matches.append([root, filename])
  
  filenames_list={}       
  for root,filename in matches:
      filename_key = (os.path.join(filename).strip()).split('.',1)[0]
  
      fullfilename = os.path.join(root, filename)
      f= open(fullfilename, 'r')
      for line in f:
          if "&lt;name, registration num'" in line:
              key=filename_key
              line+=2
              val=line
  </code></pre>