Community
    • Login

    Insert new lines

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    5 Posts 2 Posters 301 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.
    • Les forges de CalianeL
      Les forges de Caliane
      last edited by

      Hello.

      I m looking for a solution to insert new line before (=M16) and after (=M15) a line who begin with “G00”. triyng with find and replace tool and no succes for now. it’s a cnc file, .txt work well. (a large amount of coodinates for laser metal cuting)

      I hope someone can help. Thanks a lot

      1 Reply Last reply Reply Quote 0
      • Les forges de CalianeL
        Les forges de Caliane
        last edited by

        I found the multiReplace plugin, but I don’t know how to code. Data: identify the line (x) with the character sequence “G00” /
        Add a line before with “M16” / add a line after with “M15”

        exple:

        G01 X121.191 Y160.1338
        G01 X121.128 Y160.1298
        G01 X119.065 Y160.0648
        G00 X166.159 Y331.3997
        G01 X164.095 Y331.3997
        G01 X164.032 Y331.4027
        G01 X163.969 Y331.4067

        to

        G01 X121.191 Y160.1338
        G01 X121.128 Y160.1298
        G01 X119.065 Y160.0648
        M16
        G00 X166.159 Y331.3997
        M15
        G01 X164.095 Y331.3997
        G01 X164.032 Y331.4027
        G01 X163.969 Y331.4067

        1 Reply Last reply Reply Quote 1
        • Les forges de CalianeL
          Les forges de Caliane
          last edited by

          I realize that this is a lot to ask, a piece of code, you probably have other things to do. I am a self-employed blacksmith and I am grateful to have a lot of work. but it is exhausting. so if I can find some help for this project I would be very grateful. thank you

          gerdb42G 1 Reply Last reply Reply Quote 0
          • gerdb42G
            gerdb42 @Les forges de Caliane
            last edited by

            @Les-forges-de-Caliane

            you may try the following:

            • Make sure that under Search Mode “Regular Expression” is selected
            • In the “Find what” Field enter ^(G00 X[0-9\.]+ Y[0-9\.]+)
            • In “Replace with” enter =MIN16\r\n$1\r\n=MIN15
            • Hit “Find next” followed by “Replace” or use “Replace all”

            To learn more about Regular Expressions you may want to have a look at https://community.notepad-plus-plus.org/topic/15765/faq-where-to-find-regular-expressions-regex-documentation

            Les forges de CalianeL 1 Reply Last reply Reply Quote 2
            • Les forges de CalianeL
              Les forges de Caliane @gerdb42
              last edited by

              hello @gerdb42

              It works very well. your kungfu is powerful. thank you very much for the help. and thank you for the link, I will look into it.

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