MATLAB: Formatting more than 600 table

I have more than 600 tables each one has a different data. I want To put all the data in the same table (one table). I wonder how can I do that in Matlab. Any help would be greatly appreciated. I will be grateful to you.

Best Answer

A simple code (which does not preserve completely the table header):
tabledir = 'C:\wherever\the\files\are\on your\drive';
tablecount = 600; %how however many there are
tableout = 'alltables.txt' %or however you want to name it
tables = cell(tablecount, 1);
%read tables one by one into cell array
for tableidx = 1:tablecount
tablefile = sprintf('table%02d.txt', tableidx);
if ~exist(fullfile(tabledir, tablefile), 'file')
warning('skipping table %s. file does not exist', tablefile);
else
tables{tableidx} = readtable(fullfile(tabledir, tablefile)); %read table
end
end
alltables = vertcat(tables{:}); %concatenate all tables
writetable(alltables, fullfile(tabledir, tableout));
Note, that I've not tested nor debugged it, there may be some small typos, syntax errors.