Jump to content

G Code Manipulation


TimLewicki
 Share

Recommended Posts

I want to write code that will take a .txt file that may look like:

N1 G1 G90 X0 Y0 Z3. 
N2 X1.2751 Y1.82

(G Code - can be thousands of lines long. Each new line starts with N__. Leading and trailing zeros are omitted.)

Find every instance of X(and the value attached to it) and add a U(with the same value) afterward. For example, after running the software, the above will now look like:

N1 G1 G90 X0 U0 Y0 Z3.

N2 X1.2751 U1.2751 Y1.82


If been chasing various ideas and haven’t gotten very far.

Link to comment
Share on other sites

  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...