title: Reading in txt File -Matlab Line Extraction with Logic
body: <p>Currently stumped with reading in a .txt file with the general layout described below:</p>
  
  <p>(The .txt file follows this general layout "N" times)</p>
  
  <pre><code>-----------------------------------
  Header Info 1
  Desired data 1
  More data
  More data
  -----------------------------------
  Header Info 2
  Desired data 2
  More data
  -----------------------------------
  Header Info 3
  Desired data 3
  More data
  More data
  More data
  More data
  ----------------------------------
  Header Info N
  Desired data N
  More data
  More data
  More data
  CLOSING DATA LINE
  </code></pre>
  
  <p>I would like to extract only the "Desired data" along with the final "CLOSING DATA LINE" but the twist is that there is varying "More data" lines in between that inhibits a simple line-by-line extraction pattern. There can be 0-hundreds of these "More data" lines...</p>
  
  <p>I do know that my desired data is 2 lines below every "---------------" and was wondering if there is some sort of way to "detect" a "---------" and execute a line extraction 2 lines below that. Further, to get the final line, trying to implement logic to extract that line before.</p>
  
  <p>I've thought of simply going through every line with fgetl and having if statements capture the "---------" with a strcmpare which seems pretty "brute force-ish". Any lightweight or efficient solutions?</p>