Because you have a mix of datatypes in the file, I recommend that you fopen() each file, and that you textscan() the next two lines with format '%s%s%s%s%s' and 'delimiter', ';' . Save the resulting cell array A for later.
Then textscan() one line with format repmat('%s',1,13) and delimiter ';' . Save the resulting cell array B for later.
Then textscan() the remaining lines with format
['%{hh:mm:ss}T', repmat('%f', 1, 16)]
Save the resulting cell array C for later.
Now let
D = cell(size(C{1},1)+3, 17);
D(1:2, 1:5) = A;
D(3, :) = B;
D(4:end) = num2cell(cell2mat(C));
or something like that.
Now writecell() D if you have R2019b or later.
Or you perhaps might want to work in three sections, writing each section in turn, using the range specifications; the advantage of doing that is that you would not have to fiddle around with padding the arrays out to the widest (17).
0 Comments
Sign in to comment.