Community
    • Login

    Replace part of Gcode

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    5 Posts 2 Posters 4.4k Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Axel DekeyserA Offline
      Axel Dekeyser
      last edited by

      Hi,

      I want to replace a part of my Gcode.
      Example:
      G1 Z0.250 F1800.000
      G1 X84.650 Y85.654 F1800.000

      I can’t simply replace the F1800.000 because it is used in other parts. I only want to replace the F1800.000 with F90.000 in the lines with Z. The number behind the Z also changes.
      So for the example. The first line has to change but the second line has to be the same.

      I already tried:
      Find: G1 Z(.*) F1800.000
      Replace: G1 Z\1 F90 \nG1 F1800

      Where’s the mistake? It doesn’t change anything. Do I have to change the search method?

      Thank you :),

      Axel

      Claudia FrankC 1 Reply Last reply Reply Quote 0
      • Claudia FrankC Offline
        Claudia Frank @Axel Dekeyser
        last edited by

        Hallo @Axel-Dekeyser,

        Do I have to change the search method?

        Yes, if you didn’'t use regular expression

        Cheers
        Claudia

        1 Reply Last reply Reply Quote 0
        • Axel DekeyserA Offline
          Axel Dekeyser
          last edited by

          with the regular expression it also doesn’t change what I want.
          Is the Find and Replace that I use correct?

          1 Reply Last reply Reply Quote 0
          • Claudia FrankC Offline
            Claudia Frank
            last edited by

            Well it depends, your replace does more than you have described,
            so I don’t know if it is expected or just an error.
            If you could give something like

            This is what I have
            and
            this is what I want to have

            we can definitively say what is going wrong.
            So from what you described, you wanna replace F1800.000
            value in lines with Z coordinates, which of course will differ…
            From your description it is only needed to have
            G1 Z\1 F90

            There is room for simplifying the regex like
            Find: (G1 Z.* F)1800.000
            Replace with: \190

            But your find/replace should work as well.

            Cheers
            Claudia

            1 Reply Last reply Reply Quote 0
            • Axel DekeyserA Offline
              Axel Dekeyser
              last edited by

              With the simplification it worked fine :)

              Thank you so much Claudia.

              1 Reply Last reply Reply Quote 0

              Hello! It looks like you're interested in this conversation, but you don't have an account yet.

              Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

              With your input, this post could be even better 💗

              Register Login
              • First post
                Last post
              The Community of users of the Notepad++ text editor.
              Powered by NodeBB | Contributors