N lines renumbering
-
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.
-
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. -
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.