Community
    • Login

    Automatic insertion of line numbers into the text?

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    2 Posts 2 Posters 549 Views 1 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.
    • NDCTechSupportN Offline
      NDCTechSupport
      last edited by

      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!

      Alan KilbornA 1 Reply Last reply Reply Quote 0
      • Alan KilbornA Offline
        Alan Kilborn @NDCTechSupport
        last edited by Alan Kilborn

        @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

        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