<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/154379</link>
    <title>MATLAB Central Newsreader - efficient way to read this text file</title>
    <description>Feed for thread: efficient way to read this text file</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2008 by The 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>The MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Sat, 11 Aug 2007 16:45:03 -0400</pubDate>
      <title>efficient way to read this text file</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/154379#387362</link>
      <author>Varun </author>
      <description>Hi,&lt;br&gt;
&lt;br&gt;
I would like to read data from a text file that has the&lt;br&gt;
following content:&lt;br&gt;
&lt;br&gt;
TITLE="H:, "U m/s", "V m/s", "CHC", ZONE T="83.941605 um/p, &lt;br&gt;
2.014599, 83.270073, 9900000256.000000, 9900000256.000000, -1&lt;br&gt;
2.686131, 83.270073, 9900000256.000000, 9900000256.000000, -1&lt;br&gt;
3.357664, 83.270073, 9900000256.000000, 9900000256.000000, -1&lt;br&gt;
4.029197, 83.270073, 9900000256.000000, 9900000256.000000, -1&lt;br&gt;
75.883209, 44.992699, 0.026952, 0.018204, 4&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
Is there an efficient way to read just the numbers after the&lt;br&gt;
first line into a [m,n] matrix.&lt;br&gt;
&lt;br&gt;
Regards,&lt;br&gt;
Varun&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Sun, 12 Aug 2007 09:42:13 -0400</pubDate>
      <title>Re: efficient way to read this text file</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/154379#387391</link>
      <author>us</author>
      <description>Varun:&lt;br&gt;
&amp;lt;SNIP importing formatted text evergreen...&lt;br&gt;
&lt;br&gt;
&amp;gt; Is there an efficient way to read just the numbers after &lt;br&gt;
the first line into a [m,n] matrix...&lt;br&gt;
&lt;br&gt;
one of the many solutions&lt;br&gt;
&lt;br&gt;
% assume your data is in &amp;lt;foo.txt&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;fnam='foo.txt';&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;m=dlmread(fnam,',',1,0);&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Mon, 13 Aug 2007 22:53:15 -0400</pubDate>
      <title>Re: efficient way to read this text file</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/154379#387613</link>
      <author>Varun </author>
      <description>thank you, that worked&lt;br&gt;
&lt;br&gt;
varun&lt;br&gt;
&lt;br&gt;
"us " &amp;lt;us@neurol.unizh.ch&amp;gt; wrote in message&lt;br&gt;
&amp;lt;f9mkll$3hr$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; Varun:&lt;br&gt;
&amp;gt; &amp;lt;SNIP importing formatted text evergreen...&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; Is there an efficient way to read just the numbers after &lt;br&gt;
&amp;gt; the first line into a [m,n] matrix...&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; one of the many solutions&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; % assume your data is in &amp;lt;foo.txt&amp;gt;&lt;br&gt;
&amp;gt;      fnam='foo.txt';&lt;br&gt;
&amp;gt;      m=dlmread(fnam,',',1,0);&lt;br&gt;
&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Tue, 12 Feb 2008 16:02:02 -0500</pubDate>
      <title>Problem regarding data analysis containing string in the file</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/154379#414518</link>
      <author>edward kabanyas</author>
      <description>Dear All, &lt;br&gt;
I have problem in reading file containing string or&lt;br&gt;
character in my file. The following are the data example:&lt;br&gt;
&lt;br&gt;
11:48:00 -&amp;gt; 11:49:00   0.00 -&amp;gt; 0.25 mm  n=   0.0000000 /m3mm &lt;br&gt;
11:48:00 -&amp;gt; 11:49:00   0.25 -&amp;gt; 0.50 mm  n=   0.0000000 /m3mm &lt;br&gt;
11:48:00 -&amp;gt; 11:49:00   0.50 -&amp;gt; 0.75 mm  n=   0.0000000 /m3mm &lt;br&gt;
11:48:00 -&amp;gt; 11:49:00   0.75 -&amp;gt; 1.00 mm  n=   1.8491934 /m3mm &lt;br&gt;
rainrate =0.001686 mm/hr &lt;br&gt;
11:49:00 -&amp;gt; 11:50:00   0.00 -&amp;gt; 0.25 mm  n=   0.0000000 /m3mm &lt;br&gt;
11:49:00 -&amp;gt; 11:50:00   0.25 -&amp;gt; 0.50 mm  n=   0.0000000 /m3mm &lt;br&gt;
11:49:00 -&amp;gt; 11:50:00   0.50 -&amp;gt; 0.75 mm  n=   2.6686186 /m3mm &lt;br&gt;
11:49:00 -&amp;gt; 11:50:00   0.75 -&amp;gt; 1.00 mm  n=   0.0000000 /m3mm &lt;br&gt;
rainrate =0.000455 mm/hr &lt;br&gt;
11:50:00 -&amp;gt; 11:51:00   0.00 -&amp;gt; 0.25 mm  n=   0.0000000 /m3mm &lt;br&gt;
11:50:00 -&amp;gt; 11:51:00   0.25 -&amp;gt; 0.50 mm  n=   0.0000000 /m3mm &lt;br&gt;
11:50:00 -&amp;gt; 11:51:00   0.50 -&amp;gt; 0.75 mm  n=   2.3139154 /m3mm &lt;br&gt;
11:50:00 -&amp;gt; 11:51:00   0.75 -&amp;gt; 1.00 mm  n=   3.5420286 /m3mm &lt;br&gt;
rainrate =0.004181 mm/hr &lt;br&gt;
&lt;br&gt;
Desired new file structure:&lt;br&gt;
11:48:00 0.0000000 0.0000000 0.0000000 1.8491934 0.001686&lt;br&gt;
11:49:00 0.0000000 0.0000000 2.6686186 0.0000000 0.000455&lt;br&gt;
11:50:00 0.0000000 0.0000000 2.3139154 3.5420286 0.004181&lt;br&gt;
&lt;br&gt;
I really need your help. I want to pick the value of last&lt;br&gt;
coulumn (value of after n), rainrate value and time only and&lt;br&gt;
putting them in new file with structure as desired new file.&lt;br&gt;
&lt;br&gt;
That's my question, thanks very much for your best help&lt;br&gt;
&lt;br&gt;
Best regards;&lt;br&gt;
Edward&lt;br&gt;
&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Tue, 12 Feb 2008 17:38:06 -0500</pubDate>
      <title>Re: Problem regarding data analysis containing string in the file</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/154379#414555</link>
      <author>Arthur G</author>
      <description>On Tue, 12 Feb 2008 11:02:02 -0500, edward kabanyas &amp;lt;djuky_hmi@yahoo.com=&lt;br&gt;
&amp;gt;  =&lt;br&gt;
&lt;br&gt;
wrote:&lt;br&gt;
&amp;gt; Dear All,&lt;br&gt;
&amp;gt; I have problem in reading file containing string or&lt;br&gt;
&amp;gt; character in my file. The following are the data example:&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; 11:48:00 -&amp;gt; 11:49:00   0.00 -&amp;gt; 0.25 mm  n=3D   0.0000000 /m3mm&lt;br&gt;
&amp;gt; 11:48:00 -&amp;gt; 11:49:00   0.25 -&amp;gt; 0.50 mm  n=3D   0.0000000 /m3mm&lt;br&gt;
&amp;gt; 11:48:00 -&amp;gt; 11:49:00   0.50 -&amp;gt; 0.75 mm  n=3D   0.0000000 /m3mm&lt;br&gt;
&amp;gt; 11:48:00 -&amp;gt; 11:49:00   0.75 -&amp;gt; 1.00 mm  n=3D   1.8491934 /m3mm&lt;br&gt;
&amp;gt; rainrate =3D0.001686 mm/hr&lt;br&gt;
&amp;gt; 11:49:00 -&amp;gt; 11:50:00   0.00 -&amp;gt; 0.25 mm  n=3D   0.0000000 /m3mm&lt;br&gt;
&amp;gt; 11:49:00 -&amp;gt; 11:50:00   0.25 -&amp;gt; 0.50 mm  n=3D   0.0000000 /m3mm&lt;br&gt;
&amp;gt; 11:49:00 -&amp;gt; 11:50:00   0.50 -&amp;gt; 0.75 mm  n=3D   2.6686186 /m3mm&lt;br&gt;
&amp;gt; 11:49:00 -&amp;gt; 11:50:00   0.75 -&amp;gt; 1.00 mm  n=3D   0.0000000 /m3mm&lt;br&gt;
&amp;gt; rainrate =3D0.000455 mm/hr&lt;br&gt;
&amp;gt; 11:50:00 -&amp;gt; 11:51:00   0.00 -&amp;gt; 0.25 mm  n=3D   0.0000000 /m3mm&lt;br&gt;
&amp;gt; 11:50:00 -&amp;gt; 11:51:00   0.25 -&amp;gt; 0.50 mm  n=3D   0.0000000 /m3mm&lt;br&gt;
&amp;gt; 11:50:00 -&amp;gt; 11:51:00   0.50 -&amp;gt; 0.75 mm  n=3D   2.3139154 /m3mm&lt;br&gt;
&amp;gt; 11:50:00 -&amp;gt; 11:51:00   0.75 -&amp;gt; 1.00 mm  n=3D   3.5420286 /m3mm&lt;br&gt;
&amp;gt; rainrate =3D0.004181 mm/hr&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Desired new file structure:&lt;br&gt;
&amp;gt; 11:48:00 0.0000000 0.0000000 0.0000000 1.8491934 0.001686&lt;br&gt;
&amp;gt; 11:49:00 0.0000000 0.0000000 2.6686186 0.0000000 0.000455&lt;br&gt;
&amp;gt; 11:50:00 0.0000000 0.0000000 2.3139154 3.5420286 0.004181&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; I really need your help. I want to pick the value of last&lt;br&gt;
&amp;gt; coulumn (value of after n), rainrate value and time only and&lt;br&gt;
&amp;gt; putting them in new file with structure as desired new file.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; That's my question, thanks very much for your best help&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Best regards;&lt;br&gt;
&amp;gt; Edward&lt;br&gt;
&amp;gt;&lt;br&gt;
&lt;br&gt;
If you didn't have two "kinds" of lines, textscan would be helpful.&lt;br&gt;
&lt;br&gt;
But it sounds to me like you'll have to "manually" open the file,&lt;br&gt;
read it line by line, and find the last number in each line, e.g.&lt;br&gt;
use the following functions:&lt;br&gt;
&lt;br&gt;
fopen to open the file&lt;br&gt;
fgetl to read a line&lt;br&gt;
sscanf or other string functions to parse the line&lt;br&gt;
fclose to close the file&lt;br&gt;
&lt;br&gt;
--Arthur&lt;br&gt;
</description>
    </item>
  </channel>
</rss>
