help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Loading data from file and omitting some extensions


From: st.michal88
Subject: Loading data from file and omitting some extensions
Date: Wed, 22 Jan 2014 02:46:02 -0800 (PST)

Hello everybody,

 I am loading data from files and and puting it into matrices for further
calculations. My function works on multiple files and loads all the files
from directory. The  problems starts when in the same directory there are
some files with a different extension than .txt. Could you help me how to
make a statement excluding files ending with something else than .txt.?

This is the way I load the data:

 nr = readdir (pwd)
 i=rows(nr);

 for a=(1:i) 
   if (isdir(nr(a))==0)  
     data = fopen (nr(a), "r");
     A=dlmread(data,'',0,0);
     fclose(data);
 
  ...calculations...

 endfor


Greetings,
Michal



--
View this message in context: 
http://octave.1599824.n4.nabble.com/Loading-data-from-file-and-omitting-some-extensions-tp4661241.html
Sent from the Octave - General mailing list archive at Nabble.com.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]