Delete duplicates

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
User avatar
boldan
Posts: 31
Joined: Tue Jul 22, 2003 2:47 pm
Location: Toronto
Contact:

Delete duplicates

Post 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?
Jonathan_Taylor
Posts: 5
Joined: Wed Apr 30, 2003 3:02 pm
Location: Halifax, West Yorkshire, England

Post 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.
Post Reply