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
| [EMAIL PROTECTED] http://www.lucas-nussbaum.net/ |
| jabber: [EMAIL PROTECTED] GPG: 1024D/023B3F4F |
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]