How to combine multiple text file into 1 excel file?

조회 수: 1 (최근 30일)
AdeYang
AdeYang 2013년 5월 10일
The codes below gave me a folder (f) of nested cell arrays that are not of equal size, as such I was not able to write from there. I needed all the data to append into 1 sheet.
[filename folder] = uigetfile('*.txt', 'Please select data file', 'MultiSelect', 'on');
for n = 1:size(filename,2) directory = strcat (folder, filename{1,n});
fid = fopen(directory); data = testscan(fid, '%f%s%f%f%f%f%f%f%f%f%f%f%f', 'delimiter', '\t', 'headerlines',1);
fclose(fid);
a = regexp(filename, '_', 'split');
data1 = [a{1,n}{1,2} data];
if n>1 f = [f;data1];
else f = data1;
end
end
f =
'P1Blue' [1455x1 double] {1455x1 cell} [1455x1 double] [1455x1 double] ......
'P1Blue' [993x1 double] {993x1 cell} [993x1 double] [993x1 double] ......
..... and so on for 300 over files...

답변 (0개)

카테고리

Help CenterFile Exchange에서 Spreadsheets에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by