|
From: | Andy Buckle |
Subject: | Re: Loading data from file and omitting some extensions |
Date: | Wed, 22 Jan 2014 11:01:15 +0000 |
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 = "" (nr(a), "r");
A=dlmread(data,'',0,0);
fclose(data);
...calculations...
endfor
[Prev in Thread] | Current Thread | [Next in Thread] |