Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.


TextFX sort lines

  • Capum130

    Hello, I was instructed by davegb3 to use TextFX to help me find duplicated strings (and remove the repeated term). It's a .txt file which contains a list of emails addresses sequenced and separated by comma.
    I need instructions for what he wrote below (it would be great if the list continues in sequence and separated by comma):

    TextFX sort lines (only unique) will do it easier than a script, assuming you don't mind if the order changes. If you need the order to stay the same, then you'd need to add each line to a list, if it wasn't already in the list, then write the list out at the end

    emails = []
     for line in range(0, editor.getLineCount()):
     em = editor.getLine(line).rstrip('\r\n ')
     if em not in emails: