Extract specific info out of file
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Corneel Lootens
am 17 Aug. 2022
Kommentiert: Corneel Lootens
am 17 Aug. 2022
Hi,
I have a file (txt file) with info, for example kids and their scores. String (name), Int (scores), String (passed/notpassed).
For example,
Jessica 8 passed
Tom 6 passed
Ronald 4 notpassed
My question now is how can I extract the ones who passed the test and with that their scores in a new Array/File/other?
Thanks in advance
0 Kommentare
Akzeptierte Antwort
dpb
am 17 Aug. 2022
txt=readlines('yourfile.txt');
writematrix('yournewfile.txt',txt(~contains(txt,'notpassed')),'filetype','text','quotestrings',0);
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu String Parsing finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!