Replace Duplicates with Single Copy

2012-03-01
2014-01-05
  • Jonathan Archer

    Jonathan Archer - 2012-03-01

    I have a list of e-mail addresses and I would like to replace all duplicates with a single copy (\1), but I'm not sure what regex is involved to find each e-mail address. >.<

     
  • Anonymous - 2012-03-01

    Use TextFX/Tools/Sort and select output UNIQUE.

     
  • Jonathan Archer

    Jonathan Archer - 2012-03-02

    Ah, thank you - but is it possible without using the TextFX plugin? I also don't appear to have any positive response from selecting such an option. I was using a program called replace pioneer, but a regex alternative would be greatly beneficial for personal enrichment.

     
  • François-R Boyer

    If you want to remove duplicate lines, when several adjacent lines are identical, it can be done with the following regex: replace "^(.+\r?\n)\1+" by "\1".  It requires better regex support than what is currently included in Notepad++, just download the binary of this recent patch https://sourceforge.net/projects/notepad-plus/forums/forum/331753/topic/4987428 .

     
  • Jonathan Archer

    Jonathan Archer - 2012-03-03

    Thank you for your help!

     
  • Fool4UAnyway

    Fool4UAnyway - 2012-03-03

    You could use Text Crawler's Extract and one of its Search Pad features.
    www.digitalvolcano.co.uk/content/textcrawler

    Just Extract all items from the list (.* or specifiy the email address regex).
    Then in the Scratch Pad choose to remove duplicate items.

     
  • AZJIO

    AZJIO - 2014-01-05

    Add it "Edit -> Line Operations -> Remove duplicates of lines"

    You can use "Scripting.Dictionary"

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks