Jump to content

G Code Manipulation

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 post
Share on other sites
  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...