Community
    • Login

    Replacing a number with line number in text

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    2 Posts 2 Posters 1.1k Views 2 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.
    • Yosef ymjY Offline
      Yosef ymj
      last edited by

      simply i have a 340 link in text file each one in each line
      for example
      youtubecom/1
      youtubecom/1
      youtubecom/1
      youtubecom/1
      youtubecom/1
      youtubecom/1
      i want to replace the number (1) with the line number
      like this…
      youtubecom/1
      youtubecom/2
      youtubecom/3
      youtubecom/4
      youtubecom/5
      youtubecom/6
      thx

      Neil SchipperN 1 Reply Last reply Reply Quote 0
      • Neil SchipperN Offline
        Neil Schipper @Yosef ymj
        last edited by

        @yosef-ymj Hi. I suggest you learn to use Edit -> Column Editor (Alt+c) to insert a column of ascending numbers.

        Then, learn to use Alt+MouseMovement to select rectangles, and gain skill with rectangular cut/copy/paste operations.

        When working with rectangles, these are also helpful:

        • Shift+Alt+ArrowKey to adjust dimension
        • Shift+Alt+LeftMouseClick to specify opposite corner of a rectangle whose other corner is current caret position

        If your data is as uniform as shown, a sequence using the above operations will do what you want, although you may need to handle 1, 2 and 3 digit sections separately.

        To review some creative solutions to rectangular text problems, use the magnifier icon and search this site for terms like “column editor rectangle paste”.

        Drop a follow-up comment to indicate whether you succeeded.

        1 Reply Last reply Reply Quote 1

        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