Community
    • Login

    Replacing a number with line number in text

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    2 Posts 2 Posters 798 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.
    • Yosef ymjY
      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
        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
        • First post
          Last post
        The Community of users of the Notepad++ text editor.
        Powered by NodeBB | Contributors