I have a folder with many .csv files. I need to load one file at at time and perform some operations. I tried loading files in a loop using the csvread
and xlsread
command but it does not work. My files are in a .csv format but csvread
does not read it as my files have text and numbers. Hence I used `xlsread' but I get error saying the file.csv could not be found. I am unsure what the problem is.I use the following code to read files in a loop:
files=dir('foldername');
N=length(files);
for i=1:N
thisfile=xlsread(files(i).name);
end
Variable files is read as a structure and it displays filename, filelocation,bytes and dates. Should I convert to an array in order to read the contents of the file?