Finding value behind string
显示 更早的评论
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 个)
Image Analyst
2012-4-12
0 个投票
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?
类别
在 帮助中心 和 File Exchange 中查找有关 Text Data Preparation 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!