How do I store only the lines in a text file that contain a certain string?
Show older comments
I have a text file that I would like to read and I only want to display lines which start with a certain string. For example, the contents of the text file are:
FX = 698 FY = 96325 FZ = 987 MX = 87 MY = 96 MZ = 169 FX = 856 FY = 1234 FZ = 654 MX = 5916 MY = 1648 MZ = 4789
What I want to do is display only the numerical values for the lines in the text file which start with FY. Then I would like to output these values into another text file. How do I do this? Thanks!
Accepted Answer
More Answers (0)
Categories
Find more on Scripts 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!