Finding value behind string
Show older comments
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 Comment
Sebastian
on 12 Apr 2012
Accepted Answer
More Answers (1)
Image Analyst
on 12 Apr 2012
0 votes
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?
Categories
Find more on Text Data Preparation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!