by 今天不飞了
之前发了生成excel表和合并excel表的文章,各种需求就来了……
在这里把几种基础的合并方法分享给大家,其他花里胡哨的筛选合并就不要问我了。整理excel真的很无聊,给钱也不做……除非“你给得太多”
代码
提供“文件路径,新excel文件名,合并类型”即可
function MultXlsIntoOne(xlsPath,xlsName,type)
% 获取所有xls列表
dirout1 = dir(fullfile(xlsPath,'*.xls'));
dirout2 = dir(fullfile(xlsPath,'*.xlsx'));
xlsList = {
dirout1.name,dirout2.name};
fileNum = length(xlsList);
% 写
switch type
case 1 % row
idx = 1;
for n = 1:fileNum
disp([num2str(n),'--',x