• Login
Community
  • Login

Automatic insertion of line numbers into the text?

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
2 Posts 2 Posters 304 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.
  • N
    NDCTechSupport
    last edited by Oct 11, 2022, 5:04 PM

    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!

    A 1 Reply Last reply Oct 11, 2022, 5:30 PM Reply Quote 0
    • A
      Alan Kilborn @NDCTechSupport
      last edited by Alan Kilborn Oct 11, 2022, 5:32 PM Oct 11, 2022, 5:30 PM

      @NDCTechSupport

      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.

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