Community
    • Login

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

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    2 Posts 2 Posters 5.2k 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.
    • Gary ChristopherG Offline
      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 FrankC 1 Reply Last reply Reply Quote 0
      • Claudia FrankC Offline
        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

        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