Community
    • Login

    N lines renumbering

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    3 Posts 3 Posters 2.7k 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.
    • Aritz SumilleraA
      Aritz Sumillera
      last edited by

      Hello,

      I´m new in this community and I don´t know exactly how it works.
      I´m a CNC programmer and I used to use CNC Syntax Editor. I´m starting with notepad++ and I´d like to have options that I had in my old program. I don´t know if it´s posible to have them.

      The most important one is the N line renumbering.
      In my programs al the lines has N number and sometimes when I copy/past from an other program, I lose the sequence and I need to renumber by hand or with my old program.

      Is it posible to get this plugin?

      Thank you.

      1 Reply Last reply Reply Quote 0
      • Mikhail VM
        Mikhail V
        last edited by

        Hi,

        I am not sure I understand whole problem, it seems that you work
        in programming language that has numbers in source files and you
        have to deal with such sources. Is it right?
        In this case I would say that is really awkward syntax.

        What I would probably do, is just remove all the numbers from all sources
        files and work with them normally. Then, if those numbers play role
        in some system - I would just export them with numbers appended.
        For importing/exporting you would just need pair of command line
        tools.

        If you can’t do that, and you are sure you have to deal with numbers in
        sources - then you’d rather start learning one of NPP’s
        scripting plugins or other automation possibilities.
        I’d recommend Pythonscript. So you could try to manage the numbers
        by writing small scripts that work with actual text, selections, etc.

        1 Reply Last reply Reply Quote 1
        • cipher-1024C
          cipher-1024
          last edited by

          If your line numbers are the first thing on the line, and they aren’t referenced anywhere in the code (no GOTO type statements) then you could whack all the line numbers with a regular expression in the search/replace box with ^\d+ in the “find” box and nothing in the replace box. When you’re ready to number the lines again, you can go to the menu and do
          Edit->Column Editor->Number to Insert
          input your starting number, increment, and repeat parameters and NPP will insert your line numbers for you.

          If you’re going to be doing this kind of thing a lot, Mikhail’s method and workflow is probably better, but this will do in a pinch.

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