Code written on the fly, completely untested. There may be bugs / typos:
filelist = {....} %built however you want, maybe with dir
outtables = cell(size(filelist));
Avars = sprintfc('A%d', 1:5); %sprintfc is an undocumented function. In newer matlab use compose which is documented
Bvars = sprintfc('B%d', 1:5);
Tvars = sprintfc('T%d', 1:8);
Hvars = sprintfc('H%d', 1:114);
for fileidx = 1:numel(filelist)
t = readtable(fullfile('c:\somewhere', filelist{fileidx}));
teams = zeros(height(t), 8);
members = zeros(height(t), 114);
teams(sub2ind(size(teams), (1:height(t))', t.teamB)) = -1;
members(sub2ind(size(members), repmat((1:height(t))', 1, 5), t{:, Avars})) = 1;
members(sub2ind(size(members), repmat((1:height(t))', 1, 5), t{:, Bvars})) = -1;
outtables{fileidx} = array2table([teams, members], 'VariableNames', [Tvars, Hvars]);
end
writetable(vertcat(outtables{:}), fullfile('c:\somewhere', 'outname.csv'));