How to delete headers from different row positions other than at the top - MATLAB
Show older comments
I have a text file that contains multiple headers. It looks like this:
Date,time,*10ms,%%,%%,%%,%%,%%,%%,%%,%%,%%,%%,DETAILS.txt;D;%%;10 11/08/19,13:19:28,03,446,0,545.75,0,6,0,0,0,14,0 11/08/19,13:19:29,05,446,0,549.25,1.9,6,102,1,0,0,0 11/08/19,13:19:30,07,446,0,549.5,1.9,6,102,1,0,0,0 11/08/19,13:19:31,09,446,0,548.75,1.9,6,102,1,0,0,0
.
.
.
Date,time,*10ms,%%,%%,%%,%%,%%,%%,%%,%%,%%,%%,DETAILS.txt;D;%%;10 11/08/19,13:19:28,03,446,0,545.75,0,6,0,0,0,14,0 11/08/19,13:19:29,05,446,0,549.25,1.9,6,102,1,0,0,0 11/08/19,13:19:30,07,446,0,549.5,1.9,6,102,1,0,0,0 11/08/19,13:19:31,09,446,0,548.75,1.9,6,102,1,0,0,0
.
.
and so on...
I would like to write a code that deletes these header-rows and stores the rest of the data to a new file.
Could anyone help with this?
Kind regards,
Tamara
3 Comments
Daniel Shub
on 30 Aug 2011
What differentiates the header from the non-header? Do all headers start with Date,time, ...? Do all data start with 11/08/19 or a date? Are there substantially more data lines than header lines? How many lines are you talking about (1e3, 1e6, 1e10)?
Fangjun Jiang
on 30 Aug 2011
Take a look at the post again. Does each line match the line in your text file? Apply {}code format to it and make sure each line matches each line in your text file. That's important for the right solution.
Tamara
on 31 Aug 2011
Accepted Answer
More Answers (0)
Categories
Find more on Data Type Conversion in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!