I'm currently working on a study where the data is saved in .txt files for each participants. I'm looking for a way to load all the data from each files into matlab automatically. I've found many topic on loading multpile files, but i can't find a way to make it work for me.
I want to load all the files called "Log_*" into a table that goes like that:
delim = {')(',') ','(', ' ', ','};
T = readtable('Log_***.txt','Delimiter', delim,'MultipleDelimsAsOne',1);
T = removevars (T, {'Var1', 'Var2', 'Var4', 'Var6', 'Var8', 'Var10', 'Var12','Var14', 'Var16', 'Var18', 'Var26', 'Var27', 'Var31', 'Var36', 'Var40', 'Var45', 'Var47', 'Var49'});
newnames = {'essai', 'DureeEssai', 'azVoulue', 'elVoulu', 'azMesure','elMesure', 'distanceAngulaire', 'diffhorizontale', 'diffElevation', 'x1', 'y1', 'z1', 'x2', 'y2', 'z2', 'posTx', 'posTy', 'postz', 'oriTx', 'oriTy', 'oriTz', 'oriTw', 'posCx', 'posCy', 'posCz', 'oriCx', 'oriCy', 'oriCz','oriCw','distanceAngulaire_oriT_C','az_oriT','el_oriT'};
T.Properties.VariableNames = newnames;
T = T(2:2:end,:);
This works for one file at a time, but i can't manage to write a proper script to get it done for every file at once. If you know the way, i'd be glad if you could share it.
Cheers