<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/159448</link>
    <title>MATLAB Central Newsreader - read the first line from a csv file of unknown length</title>
    <description>Feed for thread: read the first line from a csv file of unknown length</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>Fri, 16 Nov 2007 16:37:05 -0500</pubDate>
      <title>read the first line from a csv file of unknown length</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/159448#401715</link>
      <author>Philip Gladwin</author>
      <description>Hello,&lt;br&gt;
Does anybody know how to solve this problem?&lt;br&gt;
&lt;br&gt;
I would like to read the column headings, as strings, &lt;br&gt;
from the first row of a comma-separated file into&lt;br&gt;
an string array.&lt;br&gt;
&lt;br&gt;
The tricky part is I would like to do this without&lt;br&gt;
specifying the number of columns in the file, as&lt;br&gt;
the column headings will change from file to file.&lt;br&gt;
&lt;br&gt;
Can anybody help?&lt;br&gt;
&lt;br&gt;
Thank you.&lt;br&gt;
&lt;br&gt;
Phil,</description>
    </item>
    <item>
      <pubDate>Fri, 16 Nov 2007 18:16:09 -0500</pubDate>
      <title>read the first line from a csv file of unknown length</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/159448#401734</link>
      <author>Scott Burnside</author>
      <description>&quot;Philip Gladwin&quot; &amp;lt;philip.gladwin@citi.com&amp;gt; wrote in &lt;br&gt;
message &amp;lt;fhkgvh$oor$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; Hello,&lt;br&gt;
&amp;gt; Does anybody know how to solve this problem?&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I would like to read the column headings, as strings, &lt;br&gt;
&amp;gt; from the first row of a comma-separated file into&lt;br&gt;
&amp;gt; an string array.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; The tricky part is I would like to do this without&lt;br&gt;
&amp;gt; specifying the number of columns in the file, as&lt;br&gt;
&amp;gt; the column headings will change from file to file.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Can anybody help?&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Thank you.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Phil,&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&lt;br&gt;
Phil, you can take a look at autodataread.m in the FEX. I &lt;br&gt;
parse the header as you describe. &lt;br&gt;
&lt;br&gt;
hth,&lt;br&gt;
Scott&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; </description>
    </item>
    <item>
      <pubDate>Fri, 16 Nov 2007 18:20:23 -0500</pubDate>
      <title>read the first line from a csv file of unknown length</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/159448#401735</link>
      <author>Dan Haeg</author>
      <description>&quot;Philip Gladwin&quot; &amp;lt;philip.gladwin@citi.com&amp;gt; wrote in message&lt;br&gt;
&amp;lt;fhkgvh$oor$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; Hello,&lt;br&gt;
&amp;gt; Does anybody know how to solve this problem?&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I would like to read the column headings, as strings, &lt;br&gt;
&amp;gt; from the first row of a comma-separated file into&lt;br&gt;
&amp;gt; an string array.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; The tricky part is I would like to do this without&lt;br&gt;
&amp;gt; specifying the number of columns in the file, as&lt;br&gt;
&amp;gt; the column headings will change from file to file.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Can anybody help?&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Thank you.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Phil,&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
This may work:&lt;br&gt;
h = actxserver('Scripting.FileSystemObject');&lt;br&gt;
ts=h.OpenTextFile(filename);&lt;br&gt;
headings=ts.ReadLine;&lt;br&gt;
&lt;br&gt;
Dan</description>
    </item>
  </channel>
</rss>

