Parsing a file with nonstandard format
Show older comments
Lets say I need to get data out of a file but I can't count on the exact format of the entire file. All I can count on is the data immediately preceding or following the data I need. In particular lets say this text exists somewhere in the file "<x>45.234</x>" and what I need is that number. It might be in its own line, or not. It might have stuff around it, or not. And there are an unknown number of these datapoints in the file. How do I read all such numbers into an array, in the order they appear? Example file attached
Accepted Answer
More Answers (0)
Categories
Find more on String Parsing 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!