MATLAB: How to read data after a specific string


I have three sets of data: raw, average, and median. They are all in different .txt files and have 1024 data points with its x, y, z, etc.
Now I'm trying to get the data into the workspace so I can run some analysis on it but I don't know how to make a code work for the three different sets. They all start with machine and measurement specifications like date, voltage, scaling, etc. for 30-60 lines and then the data starts after three *.
Example median data_date_time
Comments and machine specifications:
... (for 30-60 lines)
Data: x, y, z, etc.
... (for 1024 points).
I've read some comparable questions in the forums and tried to format the answers to my problem but I've had no luck. What I do understand is that I have to read the file from the beginning, skip all 30-60 lines before *s and read the data after but I don't know how.

Best Answer

opt = {'Delimiter',','};
fmt = repmat('%f',1,5);
C = {};
fid = fopen('test.txt','rt');
while ~feof(fid)
str = fgetl(fid);
if strncmp('***',str,3)
C{end+1} = textscan(fid,fmt,opt{:});
Your data is in C.