• Login
Community
  • Login

Replace part of Gcode

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
5 Posts 2 Posters 4.0k Views
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.
  • A
    Axel Dekeyser
    last edited by Apr 14, 2016, 6:47 PM

    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

    C 1 Reply Last reply Apr 14, 2016, 7:58 PM Reply Quote 0
    • C
      Claudia Frank @Axel Dekeyser
      last edited by Apr 14, 2016, 7:58 PM

      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
      • A
        Axel Dekeyser
        last edited by Apr 14, 2016, 8:28 PM

        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
        • C
          Claudia Frank
          last edited by Apr 14, 2016, 8:44 PM

          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
          • A
            Axel Dekeyser
            last edited by Apr 15, 2016, 6:22 AM

            With the simplification it worked fine :)

            Thank you so much Claudia.

            1 Reply Last reply Reply Quote 0
            2 out of 5
            • First post
              2/5
              Last post
            The Community of users of the Notepad++ text editor.
            Powered by NodeBB | Contributors