Find number, insert further along the line

  • 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!

    <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>

  • @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.

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

Log in to reply