How to remove a row based on text in a certain column?

1 Ansicht (letzte 30 Tage)
I'm trying to make a parser for either a .txt or .xlsx file (data can be easily converted,) but I want to omit certain lines that contain an error message. The spreadsheet has a over 100k lines and a majority of them are errors produced by the system. The error lines contain [warning] and that is the only identifier that I need to use to omit them. I've attached a screenshot of part of the data to show the format of the line. If I can post anything else that'd help let me know. Here's what I've tried so far:
DFTable(any(strcmp(table2cell(DFTable), [warning]),2), :) = []

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 14 Jun. 2019
mask = contains( string(DFTtable{:,3}), '[warning]');
DFTable(mask,:) = [];

Weitere Antworten (0)

Kategorien

Mehr zu Tables finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by