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!