title: How to advance File line reader to next line?
body: <p>I have a scenario in a script I'm writing where I do:</p>
  
  <p><strong>full gist:  <a href="https://gist.github.com/calebtote/8337449" rel="nofollow">https://gist.github.com/calebtote/8337449</a></strong></p>
  
  <pre><code>sourceFile.each_line do |line|
      if (line.start_with?(*criteria)) then 
          buffer &lt;&lt; line
          buffer &lt;&lt; "\n\n"
      end
  end
  </code></pre>
  
  <p>However, I want to add additional criteria to this that aren't as straightforward. For example, I would like to be able to parse exceptions, which may not be single line events.. so in pseudo, I want something similar to:</p>
  
  <pre><code>sourceFile.each_line do |line|
      if (line.start_with?(*criteria)) then 
          buffer &lt;&lt; line
          buffer &lt;&lt; "\n\n"
      elsif (line.start_with?("Exception:")) then
              buffer &lt;&lt; line
              line.advance #&lt;- not sure what do to here
              while !line.chomp.empty?
      end
  end
  </code></pre>
  
  <hr>
  
  <h2>Edit 1:</h2>
  
  <p>Clarification on expected inputs / outputs:</p>
  
  <pre><code># input file
  13:37:09:299         DBA               20      
  SELECT Name from Table
  
  
  Exception: Error code 50100
  Description: Bad stuff!
  Line number 243, File name: myfile.cpp
  Time: 12/31/2013 08:24:20
  
  13:37:09:301         Identity_FW       10      
  In ApplicationIdentity::operator==
  </code></pre>
  
  <hr>
  
  <pre><code>#output file
  Exception: Error code 50100
  Description: Bad stuff!
  Line number 243, File name: myfile.cpp
  Time: 12/31/2013 08:24:20
  </code></pre>