Debian Bug report logs - #398193
combine: allow to compare only on a subset of the lines

version graph

Package: moreutils; Maintainer for moreutils is Joey Hess <joeyh@debian.org>; Source for moreutils is src:moreutils.

Reported by: Lucas Nussbaum <lucas@lucas-nussbaum.net>

Date: Sun, 12 Nov 2006 11:33:02 UTC

Severity: wishlist

Found in version moreutils/0.18

Reply or subscribe to this bug.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Joey Hess <joeyh@debian.org>:
Bug#398193; Package moreutils. Full text and rfc822 format available.

Acknowledgement sent to Lucas Nussbaum <lucas@lucas-nussbaum.net>:
New Bug report received and forwarded. Copy sent to Joey Hess <joeyh@debian.org>. Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: Lucas Nussbaum <lucas@lucas-nussbaum.net>
To: submit@bugs.debian.org
Subject: combine: allow to compare only on a subset of the lines
Date: Sun, 12 Nov 2006 12:16:45 +0100
Package: moreutils
Version: 0.18
Severity: wishlist

Hi,

I often have the need to do operations like that:
  Get the lines from file1, ie:
    pkg1 ver1 comment1
    pkg2 ver2 comment2
    pkg3 ver3 comment3
    pkg4 ver4 comment4
  Where the first field is not in file2, ie:
    pkg2
    pkg3

combine file1 not file2 obviously won't work, since the whole lines are
compared. It would be great if one could specify a subset of fields on
which to compare, using cut's syntax for example, so I could write:
combine -d ' ' -f 1 file1 not file2

Of course, that causes problem with duplicate hash keys, and the cases
where the rest of the lines differ between the files. I propose the
following policy:
  for and/not:
    the lines in file1 are outputted
  for or/xor:
    the line in file1 is outputted, then the line if file2 if no
    matching line in file1

Additionnally, 'not' could be managed as a special case, not 'unifying'
the lines in file1, that is:
    pkg1 ver1 comment1
    pkg1 ver11 comment11
    pkg2 ver2 comment2
    pkg2 ver22 comment22
    pkg3 ver3 comment3
    pkg3 ver33 comment33
    pkg4 ver4 comment4
    pkg4 ver44 comment44
  not
    pkg2
    pkg3
would output:
    pkg1 ver1 comment1
    pkg1 ver11 comment11
    pkg4 ver4 comment4
    pkg4 ver44 comment44  

Anyway, all this stuff should probably be implemented together with some
test cases.
-- 
| Lucas Nussbaum
| lucas@lucas-nussbaum.net   http://www.lucas-nussbaum.net/ |
| jabber: lucas@nussbaum.fr             GPG: 1024D/023B3F4F |



Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Thu Apr 17 10:14:25 2014; Machine Name: buxtehude.debian.org

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