title: Read txt file in Matlab
body: <p>I have a trouble reading the <strong>txt</strong> file, which contains 10 columns and 2 lines of header, but the problem is that in the middle of the file the same header appears several times and <code>textread()</code> doesnt function. That's my file example:</p>
  
  <h3>file.txt</h3>
  
  <pre><code>headerline1 aaaa
  headerline2 111 123
  20/12/2000 name1 name2 name3... name8 0
  21/12/2000 name1 name2 name3... name8 0
  22/12/2000 name1 name2 name3... name8 0
  headerline1 aaaa
  headerline2 111 123
  25/12/2000 name1 name2 name3... name8 0
  27/12/2000 name1 name2 name3... name8 0
  ...
  </code></pre>
  
  <p>and this is my code I tried:</p>
  
  <pre><code>[date, name1, name2, name3, name4, name5, name6, name7, name8, status] = ...
      textread('file.txt', '%s %s %s %s %s %s %s %s %s %d', 'headerlines',2);
  </code></pre>
  
  <p>It gives the error exactly at the row with the repeated header. Do you have any ideas how could I avoid those headers and read the complete file? The problem is that I have hundreds of these types of files, so I cant delete each time manually.</p>
  
  <p>Thanks for help.</p>