MATLAB: Parser.

analyze dataparser

I am trying to find/write something that will take a data file that has some data sets in it and some text, names of data sets; and give me only the data, without the text, such that I can work with it further (assign a specific column to do a specific thing). How do I get rid of the text? I have tried having a look at inputparser, but have a hard time understanding how I can implement it, or am I looking at the wrong thing?

Best Answer

It depends. If the contents in the text file have a consistent format, many times using d=importdata('DataFile.txt') is sufficient to put the numerical data and text data aside. You can even use d=uiimport to go through it once manually and have the option to generate the code for it so you can apply it to other similar files.
If the format is not consistent, using textscan(fid,'%f') can skip the text strings.