Finding value behind string
Mostrar comentarios más antiguos
Hello everybody,
I'd like to screen a text-dokument (with numeric values and character-strings in a header section which is repeated every N rows; and numeric values in form of a matrix underneath the header) and collect all values after a certain string. The value stands periodically (alone) in the next line of a certain string.
How is it possible to collect all these values in an array?
Thanks a lot in advance, kind regards
Sebastian
1 comentario
Sebastian
el 12 de Abr. de 2012
Respuesta aceptada
Más respuestas (1)
Image Analyst
el 12 de Abr. de 2012
0 votos
How about using fread(), fgetl(), and fclose()? Open the file, call fgetl() a number of times to read and throw away the header, then read the line you want and extract the value. You could use fscanf(), textscan(), str2double() and maybe some other ways. Can you give an example of the line of text that contains the value(s) you want to extract?
Categorías
Más información sobre Text Data Preparation en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!