%21c matches exactly 21 characters including \r or \n characters and any Delimiter character you might have specified. The characters are returned.
However, since you have not changed the Whitespace property, leading whitespace (including spaces and newlines) will be skipped before the %21c is considered to start.
In your sample text, the %21c runs to include the space after the '='
%f matches a number, which could be in integer or floating point syntax. Since you have not changed the Whitespace property, leading whitespace (including spaces and newlines) will be skipped before the %f is considered to start. In your sample text, you are picking up right at the numbers and they will be converted. On the third of those lines where you have indicated that there is a space after the number and before the end, textscan would be positioned at the space. The numbers are returned.
%*[^\n] matches any number of characters up to but excluding newline (but including any carriage return), and does not return the characters, because of the * after the % . textscan would be left positioned at the newline and would not consume the newline. But when textscan cycles to the next use of the format starting the %21c over again, remember that it skips leading whitespace, so the newline will be consumed.
I would expect that format to work no matter how many empty lines there were between usable lines.
However, what I would not expect is for the HeaderLines to count properly if there is a difference in empty lines in the header range. That is what I would look into: the possibility that your format still works but that the header positioning needs refinement.
Best Answer