GNU bug report logs - #6366
join can't join on numeric fields

Previous Next

Package: coreutils;

Reported by: Alex Shinn <alexshinn <at> gmail.com>

Date: Mon, 7 Jun 2010 05:24:02 UTC

Severity: wishlist

Tags: patch

Merged with 10924, 12264

Full log


View this message in rfc822 format

From: Pádraig Brady <P <at> draigBrady.com>
To: sds <at> gnu.org
Cc: coreutils <at> gnu.org, 6366 <at> debbugs.gnu.org
Subject: bug#6366: comm: use numeric sort (optionally)
Date: Wed, 22 Aug 2012 23:00:53 +0100
unarchive 6366
stop

On 08/22/2012 09:17 PM, Sam Steingold wrote:
> Hi,
> I have a file of numbers (integers IDs) which are sorted numerically,
> but comm complains that they are not.
> I suggest that comm accept "-n" option (like sort) to use numeric sort.
> Thanks.

Yes.
comm, join, uniq really should support the same field selection
and comparision flags as sort.

There are already bugs for that:
http://bugs.gnu.org/5832
http://bugs.gnu.org/6366

For reference, the following examples show
expected an unexpected behavior respectively:

$ comm --nocheck <(printf "%s\n" a b c j k) <(printf "%s\n" a b d e j)
		a
		b
c
	d
	e
		j
k

$ comm --nocheck <(printf "%s\n" 1 2 3 10 11) <(printf "%s\n" 1 2 5 6 10)
		1
		2
3
10
11
	5
	6
	10

cheers,
Pádraig.




This bug report was last modified 6 years and 260 days ago.

Previous Next


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