Community

    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Remove line numbers from every line in a G-code program

    Help wanted · · · – – – · · ·
    2
    2
    3292
    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.
    • Gary Christopher
      Gary Christopher last edited by

      I want to remove the line numbers that appear at the beginning of each program line in several programs of up to 100000 lines (sometimes more). Each line number starts with “N” and ends with a number. For example, line one is N100, line two is N110, etc., on up to Nxxxxxx. Each line number is followed by a space before the code to be executed.

      Is there a way to do a global search and remove for any text that starts with N and ends with a space (and not touch the remaining text on the same line)?

      Claudia Frank 1 Reply Last reply Reply Quote 0
      • Claudia Frank
        Claudia Frank @Gary Christopher last edited by Claudia Frank

        @Gary-Christopher

        yes, I assume so. Use find dialog and tick regular expression.

        Find what:^N\d+\h
        

        and leave replace with empty.

        ^ means start of line
        N is literal
        \d means digits
        + means match the preceding atom one or more times
        \h means horizontal spaces ( you could also use a space by pressing the spacebar.)

        Cheers
        Claudia

        1 Reply Last reply Reply Quote 0
        • First post
          Last post
        Copyright © 2014 NodeBB Forums | Contributors