Automatic insertion of line numbers into the text?
-
Is there a Notepad++ macro or some such that I can use to automatically insert the current line number as text into a text file?
I would use this to output source line numbers in trace statements and would want the inserted line number to update when lines above the trace statement are added or deleted.
Such an automatic line number would most-commonly be used within a quoted string that’s being output.
Thanks in advance!
-
Is there a Notepad++ macro or some such that I can use to automatically insert the current line number as text into a text file?
Well, no, but probably something can be created to make it work.
…would want the inserted line number to update when lines above the trace statement are added or deleted.
Okay, but that would demand a pattern to this data; if it is ONLY a number per your request (“inserted line number”), then after the first replacement there is no pattern remaining to tell where this data should be adjusted… unless there are absolutely no other numbers appearing in your file.
Such an automatic line number would most-commonly be used within a quoted string that’s being output.
Instead of beating around the bush, why not just give a sample of what your ideal trace statement would look like? And then we’ll see what kind of help we can provide to get you there, or what kind of compromises you’ll need to make to make it feasible.