This code does what I want for one text file.
clc
clear
fid = fopen('b2-moment-z-rfile.out','rt');
linenum1 = textscan(fid, '%f %*f', 'HeaderLines',3);
linenum2 = length(linenum1{1}) + 2
fclose(fid)
fid = fopen('b2-moment-z-rfile.out','rt');
indata = textscan(fid, '%*f %f', 'HeaderLines', linenum2);
celldisp(indata)
fclose(fid);
I now want to make it so I can run it for multiple text files of different names and output the data in such a way that the number from each text file can be copied into a separate column of Excel in one go.
Can anyone help with this?
Thanks