GNU bug report logs - #13032
24.3.50; Request: Provide a `delete-duplicate-lines' command

Previous Next

Package: emacs;

Reported by: Dani Moncayo <dmoncayo <at> gmail.com>

Date: Thu, 29 Nov 2012 19:26:01 UTC

Severity: wishlist

Found in version 24.3.50

Done: Juri Linkov <juri <at> jurta.org>

Bug is archived. No further changes may be made.

Full log


Message #35 received at 13032 <at> debbugs.gnu.org (full text, mbox):

From: Dani Moncayo <dmoncayo <at> gmail.com>
To: Juri Linkov <juri <at> jurta.org>
Cc: Juanma Barranquero <lekktu <at> gmail.com>, 13032 <at> debbugs.gnu.org
Subject: Re: bug#13032: 24.3.50;
	Request: Provide a `delete-duplicate-lines' command
Date: Fri, 30 Nov 2012 08:51:34 +0100
>>>   C-u M-| awk -- '!a[$0]++' RET
>>
>> Isn't
>>
>>   C-u M-| uniq RET
>>
>> shorter and easier to type?
>
> I use `uniq' only on files where lines are sorted.  OTOH, something like
> '!a[$0]++' that is not limited to consecutive duplicates is better for
> files where lines are not sorted such as log files, etc.

My use cases usually involves compacting a collection of lines
gathered from several places.  So the compacting operation is normally
coupled with a sort operation.

Thus, the command provided by Juanma is good enough for these use
cases (I first do a `sort-lines' and then a `delete-duplicate-lines').

But I agree that it would be even better if `delete-duplicate-lines'
did TRT even when the lines are not sorted.  (I've just tested this
feature in MS-Excel, and it is so: it doesn't requires that the lines
are previously sorted)

Thank you.

-- 
Dani Moncayo




This bug report was last modified 12 years and 173 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.