Treatment G-code file
Show older comments
Hello,
I have a G-code file as you can see in the following structure :

How I can with matlab to find the number of rows which carry the character of Z and to copy the instructions between two defined rows in another file .txt.
Thank you
Accepted Answer
More Answers (1)
Bjorn Gustavsson
on 8 Jun 2020
1 vote
Maybe the easiest way it to loop through the text line-by-line and check if it contains the character 'Z' using strfind or findstr. Then it should be perfectly straightforward to keep the indices where you find your Zs.
HTH
Categories
Find more on Language Support 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!