• Login
Community
  • Login

Find number, insert further along the line

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
3 Posts 2 Posters 153 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.
  • A
    Alexander Wilson
    last edited by Aug 5, 2021, 11:08 AM

    Hi you guys!

    I have got 2550 lines where I need to search for “SM2841462” (unique for every line), and replace “XX0000000” with this - or i could delete XX000000 and insert the “SM” number here.

    Hope you can help!
    Thanks!

    <div class=“tree-branch document” onclick=“TREE.displayDoc(event, ‘SM2841462’, ‘true’)”><span title=“ABBREVIATIONS”><i class=“fa fa-file-text-o” aria-hidden=“true”></i><a href=“index%EF%B9%96page=content&id=XX0000000.html” target=“_blank”>ABBREVIATIONS</a></span></div>

    A 1 Reply Last reply Aug 5, 2021, 11:29 AM Reply Quote 0
    • A
      Alan Kilborn @Alexander Wilson
      last edited by Aug 5, 2021, 11:29 AM

      @Alexander-Wilson

      Try this bit of magic:

      • Regular expression Search mode
      • Find: (?-si)((SM\d{7}).*?)XX0{7}
      • Replace: ${1}${2}

      Learn more about regular expressions in Notepad++ HERE, as well as in the N++ documentation about them HERE .

      A 1 Reply Last reply Aug 5, 2021, 11:32 AM Reply Quote 2
      • A
        Alexander Wilson @Alan Kilborn
        last edited by Aug 5, 2021, 11:32 AM

        @Alan-Kilborn
        You are an absolute genius! That worked a treat!
        Thank you very much!

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