Page 1 of 1

Delete duplicates

Posted: Mon May 10, 2004 3:20 pm
by boldan
In sorting, there is the option of "delete duplicate lines". I assumed that, if I specify key lengths and I do check the box of "delete duplicate lines", textpad will delete the lines with duplicate keys, but it doesn't. If I am doing something wrong, how is the right way to do it?

If not, can we have this added to the wish list?

Posted: Thu May 13, 2004 2:33 pm
by Jonathan_Taylor
The option is "delete duplicate LINES".

When the file:-

a1
b1
a2

is sorted by TextPad on key from character 1, length 1, it results in

a2
a1
b1

TextPad seems to have reversed the order of "a1" and "a2". This is acceptable - I have not specified what order the second character (which is not part of the sort key) should come out in. In a sense, due to the sorting algorithm used by TextPad, "a2" has sorted higher than "a1" almost "randomly".

If TextPad were to delete duplicate lines based on duplicater KEY rather than duplicate LINES, which line should it delete, line 1 "a2" or line 2 "a1"?

I think it would be unacceptable to "randomly" delete one line rather than the other.