#drscript
#unique.py
text = DrDocument.GetText()
eol = DrDocument.GetEndOfLineCharacter()
text = text.split(eol)
#oneliner from German Python Forum (remove from list doubled entries)
text = eol.join([text[i] for i in xrange(len(text)) if text[i] not in text[:i]])
DrDocument.SetText(text)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This script removes all duplicated lines:
#drscript
#unique.py
text = DrDocument.GetText()
eol = DrDocument.GetEndOfLineCharacter()
text = text.split(eol)
#oneliner from German Python Forum (remove from list doubled entries)
text = eol.join([text[i] for i in xrange(len(text)) if text[i] not in text[:i]])
DrDocument.SetText(text)