<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/255178</link>
    <title>MATLAB Central Newsreader - Importing text files with multiple headers</title>
    <description>Feed for thread: Importing text files with multiple headers</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Thu, 02 Jul 2009 14:06:02 -0400</pubDate>
      <title>Importing text files with multiple headers</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/255178#662217</link>
      <author>Leo Steenson</author>
      <description>I am trying to import text files into matlab.  The problem is that within the files there is a text header then some numerical data then header, data, header etc.&lt;br&gt;
&lt;br&gt;
When I try to import the file (specifying that the numerical data starts on line 3) Matlab imports the first set of numerical data up until the next alphabetical line but not the whole file.&lt;br&gt;
&lt;br&gt;
I have until now just repetively specified a larger and larger header (in a loop) as all the numerical data are of equal numbers of lines, but this is not nice and I miss some data for longer files.&lt;br&gt;
&lt;br&gt;
Does anyone know of a command to ignore all lines of text and only import the data, specifically when the data is interupted through the file with words.&lt;br&gt;
&lt;br&gt;
Thanks</description>
    </item>
    <item>
      <pubDate>Thu, 02 Jul 2009 23:46:34 -0400</pubDate>
      <title>Re: Importing text files with multiple headers</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/255178#662404</link>
      <author>dpb</author>
      <description>Leo Steenson wrote:&lt;br&gt;
&amp;gt; I am trying to import text files into matlab.  The problem is that&lt;br&gt;
&amp;gt; within the files there is a text header then some numerical data then&lt;br&gt;
&amp;gt; header, data, header etc.&lt;br&gt;
...&lt;br&gt;
&amp;gt; Does anyone know of a command to ignore all lines of text and only&lt;br&gt;
&amp;gt; import the data, specifically when the data is interupted through the&lt;br&gt;
&amp;gt; file with words.&lt;br&gt;
...&lt;br&gt;
Not a prebuilt function, no--you can do the same thing as you're &lt;br&gt;
presently doing except at a lower level w/ fgetl(), fread(), sscanf(), &lt;br&gt;
strread() and friends to handle your file structure, however.&lt;br&gt;
&lt;br&gt;
Whether there's a more general version of textread() et al. at the file &lt;br&gt;
exchange that could help might be worth a look-see...&lt;br&gt;
&lt;br&gt;
--</description>
    </item>
  </channel>
</rss>

