I need to merge multiple excel sheets data into one and at the sametime be able to access the data individually, in the sense
'Lets say I have 4 excels files with same type of structure (for example K rows and 5 columns), number of rows in each excel sheet is not the same but the coulumn number is the same. Now I want to merge those Excel sheets and when I need data from file 2, the program should display only data of file 2 but the merged data should not vanish!
Next if I want to add 5th file I need to have flixibility to be able to do that as well!'
I would appretiate the help!

1 commentaire

darova
darova le 9 Mar 2020
What about for loop? Read all data together and write into file

Connectez-vous pour commenter.

 Réponse acceptée

darova
darova le 9 Mar 2020
Something like that
A1 = []
A = [];
for i = 1:n
filename = ['data' num2str(i)];
A1 = xlsread(filnemae);
A = [A;A1]; % concantenate vertically
end
xlswrite('data_full',A)

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by