When you textscan, add a count after the format. The count will be the number of times the format is re-applied, and thus limits the number of lines read with that textscan() call. You would then loop around doing such calls and splicing the data together.
In some cases you can make use of the CommentStyle parameter to cause textscan() to automatically skip parts of the input. For example, if each of the lines to be skipped started with ';' you could set CommentStyle to ';' and the lines would be skipped. If this case applies to you, you would not need to put a count on or splice the data together.