<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/156967</link>
    <title>MATLAB Central Newsreader - Importing several CSV files at the same time (600 or more)</title>
    <description>Feed for thread: Importing several CSV files at the same time (600 or more)</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>Mon, 01 Oct 2007 15:30:55 -0400</pubDate>
      <title>Importing several CSV files at the same time (600 or more)</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/156967#394632</link>
      <author>BO</author>
      <description>Hey! i need to import around 400-600 csv files to the workspace at the same time so i can take the data in those file and graph it, the issue is that i have to this trough a Gui, and using uiimport takes a lot of time. Is there a way that i can import that many files, and let the user of the gui select de directory and the number of files.&lt;br&gt;
type of files: CSV files, with 3 colums each colum a variable with around 8192 points.</description>
    </item>
    <item>
      <pubDate>Mon, 01 Oct 2007 19:33:20 -0400</pubDate>
      <title>Re: Importing several CSV files at the same time (600 or more)</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/156967#394661</link>
      <author>G.A.M. </author>
      <description>BO &amp;lt;bianca_osorio@hotmail.com&amp;gt; wrote in message&lt;br&gt;
&amp;lt;5497789.1191252685630.JavaMail.jakarta@nitrogen.mathforum.org&amp;gt;...&lt;br&gt;
&amp;gt; Hey! i need to import around 400-600 csv files to the&lt;br&gt;
workspace at the same time so i can take the data in those&lt;br&gt;
file and graph it, the issue is that i have to this trough a&lt;br&gt;
Gui, and using uiimport takes a lot of time. Is there a way&lt;br&gt;
that i can import that many files, and let the user of the&lt;br&gt;
gui select de directory and the number of files.&lt;br&gt;
&amp;gt; type of files: CSV files, with 3 colums each colum a&lt;br&gt;
variable with around 8192 points.&lt;br&gt;
&lt;br&gt;
This code doesn't include a feature for limiting the number&lt;br&gt;
of files in a directory, but you could add that easily:&lt;br&gt;
&lt;br&gt;
%let user select directory from UI, &lt;br&gt;
%and pass this directory as a parameter&lt;br&gt;
function ProcessFiles(directory)	&lt;br&gt;
	allFiles = dir(directory);&lt;br&gt;
	for k = 1 : length(allFiles)&lt;br&gt;
		if(strfind(allFiles(k).name, '.csv'))&lt;br&gt;
			processFile([directory '&amp;#092;' allFiles(k).name]);&lt;br&gt;
		end&lt;br&gt;
	end&lt;br&gt;
end</description>
    </item>
    <item>
      <pubDate>Tue, 02 Oct 2007 12:53:01 -0400</pubDate>
      <title>Re: Importing several CSV files at the same time (600 or more)</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/156967#394770</link>
      <author>BO</author>
      <description>Hey Thank u for ur answer.. i try the code u said.. just with the directory i want... to see what it does..&lt;br&gt;
%let user select directory from UI, &lt;br&gt;
%and pass this directory as a parameter&lt;br&gt;
function ProcessFiles ('C:\Users\Biankita\Documents\EQUIMAVENCA\DATA\RD04-1\FFTs\*.csv'); &lt;br&gt;
allFiles = dir('C:\Users\Biankita\Documents\EQUIMAVENCA\DATA\RD04-1\FFTs\*.csv');&lt;br&gt;
for k = 1 : 100(allFiles)&lt;br&gt;
if(strfind(allFiles(k).name, '.csv'))&lt;br&gt;
processFile([C:\Users\Biankita\Documents\EQUIMAVENCA\DATA\RD04-1\FFTs '&amp;#092;' allFiles(k).name]);&lt;br&gt;
end&lt;br&gt;
end&lt;br&gt;
end&lt;br&gt;
&amp;nbsp;but i get this...&lt;br&gt;
??? Error: File: ProcessFiles.m Line: 3 Column: 24&lt;br&gt;
Missing MATLAB operator</description>
    </item>
    <item>
      <pubDate>Tue, 02 Oct 2007 14:21:53 -0400</pubDate>
      <title>Re: Importing several CSV files at the same time (600 or more)</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/156967#394783</link>
      <author> &quot;G.A.M.</author>
      <description>On Oct 2, 8:53 am, BO &amp;lt;bianca_oso...@hotmail.com&amp;gt; wrote:&lt;br&gt;
&amp;gt; Hey Thank u for ur answer.. i try the code u said.. just with the directory i want... to see what it does..&lt;br&gt;
&amp;gt; %let user select directory from UI,&lt;br&gt;
&amp;gt; %and pass this directory as a parameter&lt;br&gt;
&amp;gt; function ProcessFiles ('C:\Users\Biankita\Documents\EQUIMAVENCA\DATA\RD04-1\FFTs\*.csv');&lt;br&gt;
&amp;gt; allFiles = dir('C:\Users\Biankita\Documents\EQUIMAVENCA\DATA\RD04-1\FFTs\*.csv');&lt;br&gt;
&amp;gt; for k = 1 : 100(allFiles)&lt;br&gt;
&amp;gt; if(strfind(allFiles(k).name, '.csv'))&lt;br&gt;
&amp;gt; processFile([C:\Users\Biankita\Documents\EQUIMAVENCA\DATA\RD04-1\FFTs '&amp;#092;' allFiles(k).name]);&lt;br&gt;
&amp;gt; end&lt;br&gt;
&amp;gt; end&lt;br&gt;
&amp;gt; end&lt;br&gt;
&amp;gt;  but i get this...&lt;br&gt;
&amp;gt; ??? Error: File: ProcessFiles.m Line: 3 Column: 24&lt;br&gt;
&amp;gt; Missing MATLAB operator&lt;br&gt;
&lt;br&gt;
I see several potential issues:&lt;br&gt;
1. Did you write the function &quot;processFile&quot;?&lt;br&gt;
2. The parameter to your main function (ProcessFiles) should probably&lt;br&gt;
be: 'C:\Users\Biankita\Documents\EQUIMAVENCA\DATA\RD04-1\FFTs'&lt;br&gt;
3. You are missing the single quotes on your first parameter to&lt;br&gt;
processFile.&lt;br&gt;
4. your for-loop syntax looks incorrect.</description>
    </item>
    <item>
      <pubDate>Tue, 02 Oct 2007 14:24:13 -0400</pubDate>
      <title>Re: Importing several CSV files at the same time (600 or more)</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/156967#394784</link>
      <author>Dan Hensley</author>
      <description>BO wrote:&lt;br&gt;
&amp;gt; Hey! i need to import around 400-600 csv files to the workspace at the same time so i can take the data in those file and graph it, the issue is that i have to this trough a Gui, and using uiimport takes a lot of time. Is there a way that i can import that many files, and let the user of the gui select de directory and the number of files.&lt;br&gt;
&amp;gt; type of files: CSV files, with 3 colums each colum a variable with around 8192 points.&lt;br&gt;
&lt;br&gt;
This is a FAQ:&lt;br&gt;
&lt;br&gt;
&lt;a href=&quot;http://www.mit.edu/~pwb/cssm/matlab-faq.html#loopoverfiles&quot;&gt;http://www.mit.edu/~pwb/cssm/matlab-faq.html#loopoverfiles&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
Dan</description>
    </item>
    <item>
      <pubDate>Tue, 02 Oct 2007 16:33:22 -0400</pubDate>
      <title>Re: Importing several CSV files at the same time (600 or more)</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/156967#394814</link>
      <author>Peter Boettcher</author>
      <description>BO &amp;lt;bianca_osorio@hotmail.com&amp;gt; writes:&lt;br&gt;
&lt;br&gt;
&amp;gt; Hey Thank u for ur answer.. i try the code u said.. just with the&lt;br&gt;
&amp;gt; directory i want... to see what it does..&lt;br&gt;
&lt;br&gt;
&amp;gt; %let user select directory from UI, &lt;br&gt;
&amp;gt; %and pass this directory as a parameter&lt;br&gt;
&amp;gt; function ProcessFiles ('C:\Users\Biankita\Documents\EQUIMAVENCA\DATA\RD04-1\FFTs\*.csv'); &lt;br&gt;
&amp;gt; allFiles = dir('C:\Users\Biankita\Documents\EQUIMAVENCA\DATA\RD04-1\FFTs\*.csv');&lt;br&gt;
&amp;gt; for k = 1 : 100(allFiles)&lt;br&gt;
&amp;gt; if(strfind(allFiles(k).name, '.csv'))&lt;br&gt;
&amp;gt; processFile([C:\Users\Biankita\Documents\EQUIMAVENCA\DATA\RD04-1\FFTs '&amp;#092;' allFiles(k).name]);&lt;br&gt;
&amp;gt; end&lt;br&gt;
&amp;gt; end&lt;br&gt;
&amp;gt; end&lt;br&gt;
&amp;gt;  but i get this...&lt;br&gt;
&amp;gt; ??? Error: File: ProcessFiles.m Line: 3 Column: 24&lt;br&gt;
&amp;gt; Missing MATLAB operator&lt;br&gt;
&lt;br&gt;
You were not supposed to replace &quot;directory&quot; with your directory.  It&lt;br&gt;
was supposed to be a function which you called using your directory as&lt;br&gt;
a parameter.&lt;br&gt;
&lt;br&gt;
If you don't know what I am talking about, take a break from this task&lt;br&gt;
and read the &quot;Getting Started&quot; part of the MATLAB documentation.&lt;br&gt;
&lt;br&gt;
-Peter</description>
    </item>
  </channel>
</rss>

