MATLAB: Using code to import data

import

I have text files that I am trying to import into MATLAB (sample attached). The text files contain data collected using sensors (named q01, q02 etc.). The first 5 lines are garbage all I really need are the lines of data after q01 and q02 (complete file has more sensors). I have 529 of these files that I am trying to read in so it is not practical to use the import tool each time. I have the file names stored in a structure (field=names). This is the code that I have tried to use to read in the data but it is not extracting all of the data.
delimeterIn=' ';
headerlinesIn=5;
%Imports data and creates a structure with separate fields for numerical
%and text data
for i=1:length(files)
x(i)=importdata(files(i).name, delimeterIn, headerlinesIn);
end
Any help efficiently reading these files in would be appreciated.

Best Answer

If the files are all the same format, use the textscan function. No file was attached, but if one magickally appears, I will do my best to help you import the data from it. (It is possible that there are subsequent header lines embedded in the file, and that may be the reason you are not able to import the entire file. There are ways to deal with that with textscan.)
Related Question