How to remove intermittent headers from data

I have a large .txt file (77,000 rows) with intermittent headers in the data (see attached picture). I'm trying to get all the numeric data into a mx3 matrix. "importdata" works great until it encounters the first intermittent head, and then it stops.
This is what I have been trying, but like I said, it stop once it reaches the first buried header
filename = 'test1.txt';
[B,delimeterOut,headerlinesOut] = importdata(filename);
Load_Time = B.data(:,1);
Load_Displacement = B.data(:,2);
Load_Force = B.data(:,3);

3 comentarios

Stephen23
Stephen23 el 4 de Ag. de 2018
@Jason Shepherd: please upload a representative file by clicking the paperclip button. Note it does not have to have lots of line, but needs to represent the pertinent features of the files.
You might be interested to read this, this concept can be adapted to read files with header rows interspersed among the data:
per isakson
per isakson el 5 de Ag. de 2018
Editada: per isakson el 5 de Ag. de 2018
"(see attached picture)" Nothing attached. You need to both [Choose File] and [Insert Image].

Iniciar sesión para comentar.

Respuestas (0)

Etiquetas

Preguntada:

el 4 de Ag. de 2018

Comentada:

el 5 de Ag. de 2018

Community Treasure Hunt

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

Start Hunting!

Translated by