Extract specific info out of file
1 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
dpb
2022-8-17
txt=readlines('yourfile.txt');
writematrix('yournewfile.txt',txt(~contains(txt,'notpassed')),'filetype','text','quotestrings',0);
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 String Parsing 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!