MATLAB: How can i import numerical data from non-tabular text file in MAtLAB

data import

solid rodfin
facet normal 9.997519e-001 2.227527e-002 0.000000e+000
outer loop
vertex 6.477990e+001 3.459198e+001 1.220000e+002
vertex 6.485231e+001 3.242616e+001 1.220000e+002
vertex 6.485231e+001 3.242616e+001 2.775558e-014
endloop
endfacet
I have text file as shown above..I only want to import numerical data from it.

Best Answer

If test.txt is your txt file, the following code will create a cell C whose cell contains your data ( all of it ). You can iterate along the cell and retrieve the data you need/want.
fid=fopen('test.txt');
C=textscan(fid,'%s');