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

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)

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

So you can just write this
xlsread('filenumber1','filenumber2'...) and so on or how? It need to be putted into the same matrix.
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)

This question is closed.

Asked:

on 23 May 2014

Closed:

on 20 Aug 2021

Community Treasure Hunt

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

Start Hunting!