title: parsing blocks of text within a text file (blocks separated by empty line)
body: <p>I'm a brand new Python user who wants to parse a text file that looks like this:</p>
  
  <pre><code>$ begin
  $ vertex -1285.6 -226.2 -538.7 0
  $ track 11 1000 0.7277 0.6765 0.1133 0
  $ end
  
  $ begin
  $ vertex -1265.3 573.1 1547.7 0
  $ track 11 1000 -0.7679 0.1650 0.6189 0
  $ end
  </code></pre>
  
  <p>For every block ($ begin ... $ end) I want to get vertex coordinates x y z:</p>
  
  <pre><code>$ begin
  $ vertex x y z 0
  $ track 11 1000 -0.7679 0.1650 0.6189 0
  $ end
  </code></pre>
  
  <p>Can somebody suggest a way to do this?
  I am very grateful for any help or advice!</p>