GNU bug report logs - #5832
Feature request: uniq -k

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: coreutils; Severity: wishlist; Reported by: Raphael Clifford <drraph@HIDDEN>; dated Sat, 3 Apr 2010 18:50:03 UTC; Maintainer for coreutils is bug-coreutils@HIDDEN.

Message received at 5832 <at> debbugs.gnu.org:


Received: (at 5832) by debbugs.gnu.org; 26 Dec 2011 18:06:18 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Dec 26 13:06:18 2011
Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1RfEwE-00048K-LL
	for submit <at> debbugs.gnu.org; Mon, 26 Dec 2011 13:06:18 -0500
Received: from mail3.vodafone.ie ([213.233.128.45])
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <P@HIDDEN>)
	id 1RfEwC-000487-FB; Mon, 26 Dec 2011 13:06:17 -0500
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: ApMBAKi2+E5tTn9m/2dsb2JhbAAMMQYOhQGkXYVSAQEBAwEjDwFGBQsLDQsCAgUWCwICCQMCAQIBRQYNAQcBAYd2pBuRB4EvhzKCGIEWBJpxjA43
Received: from unknown (HELO [192.168.1.79]) ([109.78.127.102])
	by mail3.vodafone.ie with ESMTP; 26 Dec 2011 18:03:41 +0000
Message-ID: <4EF8B6FC.3080407@HIDDEN>
Date: Mon, 26 Dec 2011 18:03:40 +0000
From: =?UTF-8?B?UMOhZHJhaWcgQnJhZHk=?= <P@HIDDEN>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:6.0) Gecko/20110816 Thunderbird/6.0
MIME-Version: 1.0
To: Paul Eggert <eggert@HIDDEN>
Subject: Re: bug#10365: [PATCH] uniq: add ability to skip last N chars or
	fields
References: <20111225125418.GA1488@chouffe> <4EF8A259.6020404@HIDDEN>
	<4EF8B14E.6030004@HIDDEN>
In-Reply-To: <4EF8B14E.6030004@HIDDEN>
X-Enigmail-Version: 1.3.2
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.5 (--)
X-Debbugs-Envelope-To: 5832
Cc: Adrien Kunysz <adrien@HIDDEN>, 10365 <at> debbugs.gnu.org,
	5832 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.11
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -2.5 (--)

On 12/26/2011 05:39 PM, Paul Eggert wrote:
> On 12/26/11 08:35, Pádraig Brady wrote:
>> supporting --key would not provide this functionality.
> 
> It would support it in the most common cases, no?
> That is, if every line has (say) 10 fields, then
> the proposed 'uniq -F3' would be equivalent to
> the proposed 'uniq -k1,7'.

That's what I thought at first too,
but then why didn't Adrien propose the
more normal --check-fields=7 rather than
the unusual -F3.

> I can't offhand think of good use cases for uniq -F
> that would not be subsumed by uniq -k.

Me too, Having a variable number of fields per line,
but ignoring the last constant N fields is very unusual,
and why I asked for a concrete example.

Personally I'm leaning towards suggesting `the rev| uniq -f | rev`
is fine for this edge case.

cheers,
Pádraig.




Information forwarded to bug-coreutils@HIDDEN:
bug#5832; Package coreutils. Full text available.

Message received at 5832 <at> debbugs.gnu.org:


Received: (at 5832) by debbugs.gnu.org; 26 Dec 2011 17:42:10 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Dec 26 12:42:10 2011
Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1RfEYs-0002po-2z
	for submit <at> debbugs.gnu.org; Mon, 26 Dec 2011 12:42:10 -0500
Received: from smtp.cs.ucla.edu ([131.179.128.62])
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <eggert@HIDDEN>)
	id 1RfEYo-0002pa-IP; Mon, 26 Dec 2011 12:42:07 -0500
Received: from localhost (localhost.localdomain [127.0.0.1])
	by smtp.cs.ucla.edu (Postfix) with ESMTP id 970DFA60008;
	Mon, 26 Dec 2011 09:39:31 -0800 (PST)
X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu
Received: from smtp.cs.ucla.edu ([127.0.0.1])
	by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id uLml8sLPEteI; Mon, 26 Dec 2011 09:39:31 -0800 (PST)
Received: from [192.168.1.10] (pool-71-189-109-235.lsanca.fios.verizon.net
	[71.189.109.235])
	by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 310FCA60007;
	Mon, 26 Dec 2011 09:39:31 -0800 (PST)
Message-ID: <4EF8B14E.6030004@HIDDEN>
Date: Mon, 26 Dec 2011 09:39:26 -0800
From: Paul Eggert <eggert@HIDDEN>
Organization: UCLA Computer Science Department
User-Agent: Mozilla/5.0 (X11; Linux i686;
	rv:8.0) Gecko/20111124 Thunderbird/8.0
MIME-Version: 1.0
To: =?UTF-8?B?UMOhZHJhaWcgQnJhZHk=?= <P@HIDDEN>
Subject: Re: bug#10365: [PATCH] uniq: add ability to skip last N chars or
	fields
References: <20111225125418.GA1488@chouffe> <4EF8A259.6020404@HIDDEN>
In-Reply-To: <4EF8A259.6020404@HIDDEN>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -2.9 (--)
X-Debbugs-Envelope-To: 5832
Cc: Adrien Kunysz <adrien@HIDDEN>, 10365 <at> debbugs.gnu.org,
	5832 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.11
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -2.9 (--)

On 12/26/11 08:35, P=C3=A1draig Brady wrote:
> supporting --key would not provide this functionality.

It would support it in the most common cases, no?
That is, if every line has (say) 10 fields, then
the proposed 'uniq -F3' would be equivalent to
the proposed 'uniq -k1,7'.

I can't offhand think of good use cases for uniq -F
that would not be subsumed by uniq -k.




Information forwarded to bug-coreutils@HIDDEN:
bug#5832; Package coreutils. Full text available.

Message received at 5832 <at> debbugs.gnu.org:


Received: (at 5832) by debbugs.gnu.org; 9 Apr 2010 06:42:53 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Apr 09 02:42:53 2010
Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1O07vY-0003B0-UD
	for submit <at> debbugs.gnu.org; Fri, 09 Apr 2010 02:42:53 -0400
Received: from smtp3-g21.free.fr ([212.27.42.3])
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <jim@HIDDEN>) id 1O07vV-0003At-Ga
	for 5832 <at> debbugs.gnu.org; Fri, 09 Apr 2010 02:42:51 -0400
Received: from smtp3-g21.free.fr (localhost [127.0.0.1])
	by smtp3-g21.free.fr (Postfix) with ESMTP id 53BF9818120
	for <5832 <at> debbugs.gnu.org>; Fri,  9 Apr 2010 08:42:42 +0200 (CEST)
Received: from mx.meyering.net (mx.meyering.net [82.230.74.64])
	by smtp3-g21.free.fr (Postfix) with ESMTP id 7482B81801B
	for <5832 <at> debbugs.gnu.org>; Fri,  9 Apr 2010 08:42:40 +0200 (CEST)
Received: by rho.meyering.net (Acme Bit-Twister, from userid 1000)
	id C59B994B; Fri,  9 Apr 2010 08:42:39 +0200 (CEST)
From: Jim Meyering <jim@HIDDEN>
To: Raphael Clifford <drraph@HIDDEN>
Subject: Re: bug#5832: Feature request: uniq -k
In-Reply-To: <m2sa8f0e1a61004050210ldc78837au595997f4ff350adc@HIDDEN>
	(Raphael Clifford's message of "Mon, 5 Apr 2010 10:10:46 +0100")
References: <p2sa8f0e1a61004031139mc725d94kf74612a01fd6179b@HIDDEN>
	<h2yf5c1222c1004032122g79c24f53n1c93351c4b0aee2c@HIDDEN>
	<m2sa8f0e1a61004050210ldc78837au595997f4ff350adc@HIDDEN>
Date: Fri, 09 Apr 2010 08:42:39 +0200
Message-ID: <87sk755dpc.fsf@HIDDEN>
Lines: 22
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Spam-Score: -1.6 (-)
X-Debbugs-Envelope-To: 5832
Cc: Steve Ward <planet36@HIDDEN>, 5832 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.11
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/pipermail/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -2.8 (--)

Raphael Clifford wrote:
> Yes http://lists.gnu.org/archive/html/bug-coreutils/2006-06/msg00211.html
> in particular is pretty much exactly the same feature request.
>
> What is the current thinking on this?

uniq's -k is still something we'd like.

>> uniq: missing option -W / --check-fields=N
>> http://lists.gnu.org/archive/html/bug-coreutils/2006-06/msg00168.html

I glanced through most of that thread, and the guidance is still valid.
If you are interested, be sure to start the copyright
assignment paperwork:

    http://git.savannah.gnu.org/cgit/coreutils.git/tree/HACKING#n327 copyright

and to read/follow the other guidelines in HACKING.

2nd most important: to save yourself the pain of reworking big chunks
of code, and to keep review request size manageable, I suggest
you keep the mailing list in the loop on what you're doing/planning.




Information forwarded to owner <at> debbugs.gnu.org, bug-coreutils@HIDDEN:
bug#5832; Package coreutils. Full text available.

Message received at 5832 <at> debbugs.gnu.org:


Received: (at 5832) by debbugs.gnu.org; 5 Apr 2010 09:38:51 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 05 05:38:51 2010
Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Nyile-0006Lq-7E
	for submit <at> debbugs.gnu.org; Mon, 05 Apr 2010 05:38:51 -0400
Received: from fg-out-1718.google.com ([72.14.220.158])
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <drraph@HIDDEN>) id 1NyiKY-0006Bf-E1
	for 5832 <at> debbugs.gnu.org; Mon, 05 Apr 2010 05:10:51 -0400
Received: by fg-out-1718.google.com with SMTP id d23so991068fga.15
	for <5832 <at> debbugs.gnu.org>; Mon, 05 Apr 2010 02:10:47 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:received:in-reply-to:references
	:date:received:message-id:subject:from:to:cc:content-type
	:content-transfer-encoding;
	bh=gp0P1M/FW+CaCaJNbY4lFN8YT8Z78Zz56XsaEujZ8pM=;
	b=rLGnM7xcm3QKG1K6/HqE0E0cw0ibYI9kB7sO5WIKJqLAl/AlpoGfEGoK3VoD7tcG8W
	QUAPO74yZS+dQw8zjK+xUM3H1+Jdym/TSL+gpi4NvyDTFCF8eTo++8AXDtLTpVR/w88g
	iG19noOWqprZX2kN759XxMY3szbYnWW5E/pjc=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type:content-transfer-encoding;
	b=oJMGCRy1wl5pYViC+TWJqGgTz4GsksQan0aE3ihdCH/LRpLXzwkFT2CcA5t2l+xakH
	6/PWyLdKH1QuxjaxEjHxteV0l8of+SR82EstrcQwat1l2KQGaELBZtPswIEtlXKViQA0
	yG5Jk32zGx0ldZMt5NUlNsZkXcA27ThEF42G0=
MIME-Version: 1.0
Received: by 10.239.134.7 with HTTP; Mon, 5 Apr 2010 02:10:46 -0700 (PDT)
In-Reply-To: <h2yf5c1222c1004032122g79c24f53n1c93351c4b0aee2c@HIDDEN>
References: <p2sa8f0e1a61004031139mc725d94kf74612a01fd6179b@HIDDEN>
	<h2yf5c1222c1004032122g79c24f53n1c93351c4b0aee2c@HIDDEN>
Date: Mon, 5 Apr 2010 10:10:46 +0100
Received: by 10.239.187.129 with SMTP id l1mr445078hbh.86.1270458646743; Mon, 
	05 Apr 2010 02:10:46 -0700 (PDT)
Message-ID: <m2sa8f0e1a61004050210ldc78837au595997f4ff350adc@HIDDEN>
Subject: Re: bug#5832: Feature request: uniq -k
From: Raphael Clifford <drraph@HIDDEN>
To: Steve Ward <planet36@HIDDEN>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 5832
X-Mailman-Approved-At: Mon, 05 Apr 2010 05:38:48 -0400
Cc: 5832 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.11
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/pipermail/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -1.3 (-)

Yes http://lists.gnu.org/archive/html/bug-coreutils/2006-06/msg00211.html
in particular is pretty much exactly the same feature request.

What is the current thinking on this?

Raphael

On 4 April 2010 05:22, Steve Ward <planet36@HIDDEN> wrote:
> This might be relevant:
>
> uniq: missing option -W / --check-fields=3DN
> http://lists.gnu.org/archive/html/bug-coreutils/2006-06/msg00168.html
>
>
>
> Steve
>
>
> On Sat, Apr 3, 2010 at 14:39, Raphael Clifford <drraph@HIDDEN> wrote:
>>
>> Please excuse the cross-post but I have been told this is the
>> appropriate place to place a feature request.
>>
>> Is it possible to make a feature request for uniq to add the "-k"
>> option to specify
>> fields? =A0Interestingly uniq already has such things as
>>
>> -f, --skip-fields=3DN
>> =A0 =A0 =A0 =A0 =A0 =A0 avoid comparing the first N fields
>> and
>>
>> =A0-s, --skip-chars=3DN
>> =A0 =A0 =A0 =A0 =A0 =A0 avoid comparing the first N characters
>>
>> but no explicit option to specify which fields should be considered
>> when doing the comparison. =A0This would be very useful, for example,
>> when removing duplicates from time series data (where you are only
>> worried about consecutive duplicates on certain fields). =A0The awk
>> equivalent would be something like
>>
>> awk '$2$3$4$5 !=3D =A0p; {p=3D$2$3$4$5}'
>>
>> for using fields 2 to 5 as comparators.
>>
>> Raphael
>>
>> P.S. http://www.opengroup.org/onlinepubs/9699919799/utilities/uniq.html
>> is the posix specification for uniq if that is of any interest.
>> Curiously it says nothing about which duplicate line to keep when you
>> don't consider all fields in the comparison.
>>
>>
>>
>>
>>
>
>




Information forwarded to owner <at> debbugs.gnu.org, bug-coreutils@HIDDEN:
bug#5832; Package coreutils. Full text available.

Message received at 5832 <at> debbugs.gnu.org:


Received: (at 5832) by debbugs.gnu.org; 4 Apr 2010 14:30:20 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Apr 04 10:30:19 2010
Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1NyQqA-0007to-52
	for submit <at> debbugs.gnu.org; Sun, 04 Apr 2010 10:30:18 -0400
Received: from mail-yw0-f201.google.com ([209.85.211.201])
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <planet36@HIDDEN>) id 1NyHMN-0003BM-Ks
	for 5832 <at> debbugs.gnu.org; Sun, 04 Apr 2010 00:22:56 -0400
Received: by ywh39 with SMTP id 39so1971544ywh.21
	for <5832 <at> debbugs.gnu.org>; Sat, 03 Apr 2010 21:22:52 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:received:in-reply-to:references
	:from:date:received:message-id:subject:to:cc:content-type;
	bh=jNShPMbTd2NrVZUn3Qhy/DWi9qC59Jzdnbn9XAb+X2U=;
	b=WzOSwas3P2Q71ZzwOtkuQCV3LxewfakpGmlGIjo17q9HLuMU8er+thQIZcxBJ9OUdH
	oRakyGiihgLesqebsiiTtvfUcNqo2YnWiFV7Pj1DXS4OPVBMt4lJb1Fthu+kmyT7i34d
	E6I6nj7jnWoXSEMLgR6ta9byTB5J3V6TlbIC0=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:in-reply-to:references:from:date:message-id:subject:to
	:cc:content-type;
	b=fGImOXYhuZVl8+nsHr1GRaV2Ivb29+wZFLzRYqG/ZATR9RupSiDL/ABwOlwSIKD02h
	NDlDIozeazTQaK8wR7n0ws0WpLrjIDUN0tWj4/MowWdf8XyHuVkHjR8fvjwiwU8ORSrF
	ZNuCjKUXwTEjfR/MN0YKMMAujn4/+VPWPh1hc=
MIME-Version: 1.0
Received: by 10.150.200.7 with HTTP; Sat, 3 Apr 2010 21:22:31 -0700 (PDT)
In-Reply-To: <p2sa8f0e1a61004031139mc725d94kf74612a01fd6179b@HIDDEN>
References: <p2sa8f0e1a61004031139mc725d94kf74612a01fd6179b@HIDDEN>
From: Steve Ward <planet36@HIDDEN>
Date: Sun, 4 Apr 2010 00:22:31 -0400
Received: by 10.151.59.20 with SMTP id m20mr4641440ybk.82.1270354971417; Sat, 
	03 Apr 2010 21:22:51 -0700 (PDT)
Message-ID: <h2yf5c1222c1004032122g79c24f53n1c93351c4b0aee2c@HIDDEN>
Subject: Re: bug#5832: Feature request: uniq -k
To: Raphael Clifford <drraph@HIDDEN>
Content-Type: multipart/alternative; boundary=001517510fc8cf65a404836190b9
X-Spam-Score: -2.6 (--)
X-Debbugs-Envelope-To: 5832
X-Mailman-Approved-At: Sun, 04 Apr 2010 10:30:17 -0400
Cc: 5832 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.11
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/pipermail/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -2.6 (--)

--001517510fc8cf65a404836190b9
Content-Type: text/plain; charset=ISO-8859-1

This might be relevant:

uniq: missing option -W / --check-fields=N
http://lists.gnu.org/archive/html/bug-coreutils/2006-06/msg00168.html



Steve


On Sat, Apr 3, 2010 at 14:39, Raphael Clifford <drraph@HIDDEN> wrote:

> Please excuse the cross-post but I have been told this is the
> appropriate place to place a feature request.
>
> Is it possible to make a feature request for uniq to add the "-k"
> option to specify
> fields?  Interestingly uniq already has such things as
>
> -f, --skip-fields=N
>             avoid comparing the first N fields
> and
>
>  -s, --skip-chars=N
>             avoid comparing the first N characters
>
> but no explicit option to specify which fields should be considered
> when doing the comparison.  This would be very useful, for example,
> when removing duplicates from time series data (where you are only
> worried about consecutive duplicates on certain fields).  The awk
> equivalent would be something like
>
> awk '$2$3$4$5 !=  p; {p=$2$3$4$5}'
>
> for using fields 2 to 5 as comparators.
>
> Raphael
>
> P.S. http://www.opengroup.org/onlinepubs/9699919799/utilities/uniq.html
> is the posix specification for uniq if that is of any interest.
> Curiously it says nothing about which duplicate line to keep when you
> don't consider all fields in the comparison.
>
>
>
>
>
>

--001517510fc8cf65a404836190b9
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

This might be relevant:<br><br>uniq: missing option -W / --check-fields=3DN=
<br><a href=3D"http://lists.gnu.org/archive/html/bug-coreutils/2006-06/msg0=
0168.html">http://lists.gnu.org/archive/html/bug-coreutils/2006-06/msg00168=
.html</a><br>

<br><br><br>Steve<br><br><br><div class=3D"gmail_quote">On Sat, Apr 3, 2010=
 at 14:39, Raphael Clifford <span dir=3D"ltr">&lt;<a href=3D"mailto:drraph@=
gmail.com">drraph@HIDDEN</a>&gt;</span> wrote:<br><blockquote class=3D"g=
mail_quote" style=3D"margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(=
204, 204, 204); padding-left: 1ex;">

Please excuse the cross-post but I have been told this is the<br>
appropriate place to place a feature request.<br>
<br>
Is it possible to make a feature request for uniq to add the &quot;-k&quot;=
<br>
option to specify<br>
fields? =A0Interestingly uniq already has such things as<br>
<br>
-f, --skip-fields=3DN<br>
 =A0 =A0 =A0 =A0 =A0 =A0 avoid comparing the first N fields<br>
and<br>
<br>
=A0-s, --skip-chars=3DN<br>
 =A0 =A0 =A0 =A0 =A0 =A0 avoid comparing the first N characters<br>
<br>
but no explicit option to specify which fields should be considered<br>
when doing the comparison. =A0This would be very useful, for example,<br>
when removing duplicates from time series data (where you are only<br>
worried about consecutive duplicates on certain fields). =A0The awk<br>
equivalent would be something like<br>
<br>
awk &#39;$2$3$4$5 !=3D =A0p; {p=3D$2$3$4$5}&#39;<br>
<br>
for using fields 2 to 5 as comparators.<br>
<br>
Raphael<br>
<br>
P.S. <a href=3D"http://www.opengroup.org/onlinepubs/9699919799/utilities/un=
iq.html" target=3D"_blank">http://www.opengroup.org/onlinepubs/9699919799/u=
tilities/uniq.html</a><br>
is the posix specification for uniq if that is of any interest.<br>
Curiously it says nothing about which duplicate line to keep when you<br>
don&#39;t consider all fields in the comparison.<br>
<br>
<br>
<br>
<br>
<br>
</blockquote></div><br>

--001517510fc8cf65a404836190b9--




Information forwarded to owner <at> debbugs.gnu.org, bug-coreutils@HIDDEN:
bug#5832; Package coreutils. Full text available.
Severity set to 'wishlist' from 'normal' Request was from bob@HIDDEN (Bob Proulx) to control <at> debbugs.gnu.org. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 3 Apr 2010 18:49:11 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Apr 03 14:49:10 2010
Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Ny8P7-00049I-Ub
	for submit <at> debbugs.gnu.org; Sat, 03 Apr 2010 14:49:10 -0400
Received: from mail.gnu.org ([199.232.76.166] helo=mx10.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <drraph@HIDDEN>) id 1Ny8Ff-00044v-Fr
	for submit <at> debbugs.gnu.org; Sat, 03 Apr 2010 14:39:24 -0400
Received: from lists.gnu.org ([199.232.76.165]:39740)
	by monty-python.gnu.org with esmtps
	(TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60)
	(envelope-from <drraph@HIDDEN>) id 1Ny8Fb-0006jK-48
	for submit <at> debbugs.gnu.org; Sat, 03 Apr 2010 14:39:19 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1Ny8Fa-0000A0-FV
	for bug-coreutils@HIDDEN; Sat, 03 Apr 2010 14:39:18 -0400
Received: from [140.186.70.92] (port=34469 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1Ny8FZ-00009l-38
	for bug-coreutils@HIDDEN; Sat, 03 Apr 2010 14:39:17 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.0 (2010-01-18) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,
	RCVD_IN_DNSWL_NONE,T_DKIM_INVALID,T_TO_NO_BRKTS_FREEMAIL
	autolearn=unavailable version=3.3.0
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <drraph@HIDDEN>) id 1Ny8FX-0007wC-Oh
	for bug-coreutils@HIDDEN; Sat, 03 Apr 2010 14:39:16 -0400
Received: from mail-fx0-f212.google.com ([209.85.220.212]:35201)
	by eggs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <drraph@HIDDEN>) id 1Ny8FX-0007w8-Gu
	for bug-coreutils@HIDDEN; Sat, 03 Apr 2010 14:39:15 -0400
Received: by fxm4 with SMTP id 4so1201033fxm.26
	for <bug-coreutils@HIDDEN>; Sat, 03 Apr 2010 11:39:14 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:received:date:received:message-id
	:subject:from:to:content-type;
	bh=jdSHKbdsEp8qtr1CB7H6mHBO0XGFlWNqpcLh7qIIais=;
	b=DeMSLDwW+kvOB4gZ1XL7z6hTt/9tKbWydbFewa23aKC3bXKqLuRKQ7+WsczBDwxGwg
	VmhJZ/2jNEUsY7JVK4eqru4UsSXxb0HvjmrjwyXCRENJKnUGi2X2JM+9ROc1svEurdfM
	pguQ/lOwAHKS2ndLXOHYI+tNyAr2cwY22Vm14=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:date:message-id:subject:from:to:content-type;
	b=wXqKJNSp4+wJtvFbOa+vmUMMwAXbyLfBJ4U77Q5I8WvpLw4L9qGzQmQqGlJxMMbP3e
	vo3OlzOvOCiXOHfjxhvLnuqJkbcVK0VHR9OvFOLklqSXo6vKCpkVrRWAbCR3P2HWoaT0
	jpfJNEx/J+oVulW/YMC74mnH28hm8fS3Ix2Mo=
MIME-Version: 1.0
Received: by 10.239.179.133 with HTTP; Sat, 3 Apr 2010 11:39:14 -0700 (PDT)
Date: Sat, 3 Apr 2010 19:39:14 +0100
Received: by 10.239.132.5 with SMTP id 5mr292592hbp.137.1270319954470; Sat, 03 
	Apr 2010 11:39:14 -0700 (PDT)
Message-ID: <p2sa8f0e1a61004031139mc725d94kf74612a01fd6179b@HIDDEN>
Subject: Feature request: uniq -k
From: Raphael Clifford <drraph@HIDDEN>
To: bug-coreutils@HIDDEN
Content-Type: text/plain; charset=ISO-8859-1
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6,
	seldom 2.4 (older, 4)
X-Spam-Score: -3.3 (---)
X-Debbugs-Envelope-To: submit
X-Mailman-Approved-At: Sat, 03 Apr 2010 14:49:08 -0400
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.11
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/pipermail/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -4.6 (----)

Please excuse the cross-post but I have been told this is the
appropriate place to place a feature request.

Is it possible to make a feature request for uniq to add the "-k"
option to specify
fields?  Interestingly uniq already has such things as

-f, --skip-fields=N
             avoid comparing the first N fields
and

 -s, --skip-chars=N
             avoid comparing the first N characters

but no explicit option to specify which fields should be considered
when doing the comparison.  This would be very useful, for example,
when removing duplicates from time series data (where you are only
worried about consecutive duplicates on certain fields).  The awk
equivalent would be something like

awk '$2$3$4$5 !=  p; {p=$2$3$4$5}'

for using fields 2 to 5 as comparators.

Raphael

P.S. http://www.opengroup.org/onlinepubs/9699919799/utilities/uniq.html
is the posix specification for uniq if that is of any interest.
Curiously it says nothing about which duplicate line to keep when you
don't consider all fields in the comparison.





Acknowledgement sent to Raphael Clifford <drraph@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-coreutils@HIDDEN. Full text available.
Report forwarded to owner <at> debbugs.gnu.org, bug-coreutils@HIDDEN:
bug#5832; Package coreutils. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 25 Nov 2019 12:00:02 UTC

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