How to read a text file with multiple data sets in it with a starting line?

3 次查看(过去 30 天)
I have a data file that is from a CNC machine with load cells. I want to read it in to matlab and be able to analyze it, but it includes multiple datasets in the same file that are divided by a start line. I usually use readtable or textscan to getdata into matlab, but how can I read it in with the different start lines?
The machine outputs a file that follows the example below.
Header Line (data, x force, y force, z force, etc)
Machine Start Line
DATA,DATA,DATA,DATA
DATA,DATA,DATA,DATA
DATA,DATA,DATA,DATA
Machine Start Line
DATA,DATA,DATA,DATA
DATA,DATA,DATA,DATA
DATA,DATA,DATA,DATA
Machine Start Line
DATA,DATA,DATA,DATA
DATA,DATA,DATA,DATA
DATA,DATA,DATA,DATA

采纳的回答

John Hunt
John Hunt 2020-7-30
While I was looking into this I ran into the "importdata" function which splits up my data into two parts. The first is "text data" and the other are numbers. In the number matrix I have rows that are all NaN because they are the "Machine Start Line" so I am using that to bring in the data and if there is a NaN to separate it into parts.
Thanks

更多回答(0 个)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by