MATLAB: How to extract part of the information

This is what i have. (note: originally i have 7 columns but i have only shown just 2 columns for convenience)
'No.' 'Time'
'1' '0.000000000'
'2' '0.100209000'
'3' '0.199458000'
'4' '0.299589000'
'5' '0.399856000'
'6' '0.499050000'
'7' '0.599287000'
'8' '0.698449000'
'9' '0.798677000'
'10' '0.898885000'
'
'1000' '99.00000000'
Here is the code i use to extract
fid = fopen('eT1.txt', 'r');
data = textscan(fid, '%d%f%s%s%s%d%s', 'MultipleDelimsAsOne',true, 'HeaderLines',1);
fclose(fid);
But what i want only 1000 values extracted. In that case i need all the 7 columns but till No==1000. how to do that?

Best Answer

Assuming you only want 1000 rows and not just 1000 values (which is not a multiple of 7):
data = textscan(fid, '%d%f%s%s%s%d%s', 1000, 'MultipleDelimsAsOne',true, 'HeaderLines',1);
It's all there in the documentation of textscan (parameter N)