Merging multiple file excel

6 views (last 30 days)
Hi, I have 1000 file excel with only two field in column: time and value.
I would like to merge in one excel file with only two columns.
There is something solution?

Accepted Answer

Mathieu NOE
Mathieu NOE on 21 Sep 2021
hello Rachele
you can do this -
I used natsortfile (from FEX : ) to make sure the data are grabbed from the files in their natural name sorting which is not what matlab does autmatically
fileDir = pwd;
outfile = 'OUT.xlsx'; % output file name
fileNames = dir(fullfile(fileDir,'data*.xlsx')); % get list of data files in directory
fileNames_sorted = natsortfiles({}); % sort file names into order (
M= length (fileNames_sorted);
out_data = [];
for f = 1:M
% option # 1 for numeric data only using importdata
raw = importdata( fullfile(fileDir, fileNames_sorted{f}));
% vertical contatenation of all individual files data
out_data = [out_data;];
% store out_data in excel file

More Answers (1)

Mathieu NOE
Mathieu NOE on 21 Sep 2021




Community Treasure Hunt

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

Start Hunting!