This approach has worked with previous files with header lines within the file that I’ve successfully used textscan to read, but it doesn’t work with the file you posted because there is no end-of-file marker. It cuts off in the middle of one line, and that screws up everything.
Anyway, the code for the complete file (with the end-of-file marker) would be:
fidi = fopen('Mehak Jabbar ppppprofile120.txt','r');
k1 = 0;
while ~feof(fidi)
k1 = k1 + 1;
D{k1} = textscan(fidi, '%f%f%f%f%f', 'HeaderLines',2, 'Delimiter','\n', 'CollectOutput',1);
fseek(fidi,0,0);
end
fclose(fidi);
A version of this works for the first 8 sections (that you attached in part), so I know it will import all but the first two lines in each section. Note that the second line in each section has a string at the end of the line, so since there appears to not be any way to allow for a string at the end of all the lines, it is necessary to discard it in the textscan call.
It would be necessary to run the loop again, this time with:
D1{k1} = textscan(fidi, '%f%f%f%f%f%s', 'HeaderLines',1, 'Delimiter','\n', 'CollectOutput',1);
to pick up those ‘second’ lines. There are other ways, but this is (paradoxically) the easiest. You would then have to insert those lines in the appropriate rows of your matrix, but considering that you have several different cells, that would definitely be inconvenient but should not be terribly difficult.