Info

This question is closed. Reopen it to edit or answer.

How to put more than one excel files into a single text document

1 view (last 30 days)
We have 7 excel files, which we first need to put into a matrix and then eksport it into a text file In row 1 we need to have the input from the first excel file in our matrix In row 2 we need to have the input from the second excel file in our matrix and so on After we have putted all of them into a matrix we want to export this matrix We want to make a function which should do this. Anybody who knows how to do this?

Answers (1)

Azzi Abdelmalek
Azzi Abdelmalek on 23 May 2014
Use xlsread to import your 7 files, then concatenate your data. You can use dlmwrite to write your final matrix to a text file
  2 Comments
matnick
matnick on 23 May 2014
So you can just write this
xlsread('filenumber1','filenumber2'...) and so on or how? It need to be putted into the same matrix.
Azzi Abdelmalek
Azzi Abdelmalek on 23 May 2014
I don't know how your xls are named, suppose their names are, abc.xlsx and efg.xlsx
f={'abc.xlsx' , 'efg.xlsx'}
data=[];
for k=1:numel(f)
data=[data ; xlsread(f{k})];
end
dlmwrite('file.txt',data)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!