Borrar filtros
Borrar filtros

Extract specific info out of file

1 visualización (últimos 30 días)
Corneel Lootens
Corneel Lootens el 17 de Ag. de 2022
Comentada: Corneel Lootens el 17 de Ag. de 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

Respuesta aceptada

dpb
dpb el 17 de Ag. de 2022
txt=readlines('yourfile.txt');
writematrix('yournewfile.txt',txt(~contains(txt,'notpassed')),'filetype','text','quotestrings',0);

Más respuestas (0)

Categorías

Más información sobre String Parsing en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by