X-Loop: help-debbugs@HIDDEN Subject: bug#7068: Feature request: uniq --field-separator="SEP" --consider-fields="a, b, c" --ignore-fields="x, y, z" Resent-From: Stefan Nowak <p.org@HIDDEN> Original-Sender: debbugs-submit-bounces <at> debbugs.gnu.org Resent-To: owner <at> debbugs.gnu.org Resent-CC: bug-coreutils@HIDDEN Resent-Date: Sat, 18 Sep 2010 23:03:02 +0000 Resent-Message-ID: <handler.7068.B.128485097816773 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: report 7068 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: 7068 <at> debbugs.gnu.org X-Debbugs-Original-To: bug-coreutils@HIDDEN Received: via spool by submit <at> debbugs.gnu.org id=B.128485097816773 (code B ref -1); Sat, 18 Sep 2010 23:03:02 +0000 Received: (at submit) by debbugs.gnu.org; 18 Sep 2010 23:02:58 +0000 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 1Ox6Qr-0004MU-7m for submit <at> debbugs.gnu.org; Sat, 18 Sep 2010 19:02:58 -0400 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from <p.org@HIDDEN>) id 1Ox66a-0004DC-4w for submit <at> debbugs.gnu.org; Sat, 18 Sep 2010 18:42:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from <p.org@HIDDEN>) id 1Ox68u-0002rD-V1 for submit <at> debbugs.gnu.org; Sat, 18 Sep 2010 18:44:25 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) 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_TO_NO_BRKTS_FREEMAIL autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([199.232.76.165]:59764) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from <p.org@HIDDEN>) id 1Ox68u-0002r9-Ss for submit <at> debbugs.gnu.org; Sat, 18 Sep 2010 18:44:24 -0400 Received: from [140.186.70.92] (port=38632 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ox68t-0004nd-HS for bug-coreutils@HIDDEN; Sat, 18 Sep 2010 18:44:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from <p.org@HIDDEN>) id 1Ox68s-0002qI-8d for bug-coreutils@HIDDEN; Sat, 18 Sep 2010 18:44:23 -0400 Received: from mailout-de.gmx.net ([213.165.64.23]:57703 helo=mail.gmx.net) by eggs.gnu.org with smtp (Exim 4.69) (envelope-from <p.org@HIDDEN>) id 1Ox68r-0002pk-RX for bug-coreutils@HIDDEN; Sat, 18 Sep 2010 18:44:22 -0400 Received: (qmail invoked by alias); 18 Sep 2010 22:44:19 -0000 Received: from d86-32-104-53.cust.tele2.at (EHLO [192.168.1.2]) [86.32.104.53] by mail.gmx.net (mp001) with SMTP; 19 Sep 2010 00:44:19 +0200 X-Authenticated: #14749042 X-Provags-ID: V01U2FsdGVkX19Ru61xviVRh1hQenplsUW13SlTDmoCArgCWQbD+i oz9disb4rGiNYM Message-Id: <016CD1D6-E98C-449C-BAAB-EB698D0C2B0F@HIDDEN> From: Stefan Nowak <p.org@HIDDEN> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v935.3) Date: Sun, 19 Sep 2010 00:44:17 +0200 X-Mailer: Apple Mail (2.935.3) X-Y-GMX-Trusted: 0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Spam-Score: -4.0 (----) X-Mailman-Approved-At: Sat, 18 Sep 2010 19:02:56 -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: -5.0 (-----) Hello developers! CURRENT SYNTAX: http://www.gnu.org/software/coreutils/manual/html_node/uniq-invocation.html --skip-fields=n Skip n fields on each line before checking for uniqueness. Use a null string for comparison if a line has fewer than n fields. Fields are sequences of non-space non-tab characters that are separated from each other by at least one space or tab. --- FEATURE REQUEST #1 --- --field-separator="SEP", -F EXAMPLE: Scenario: Imagine a filesystem listing. Because of the hierarchical nature, all entries are unique. Now I want to ignore the filepath- prefix (skip the field/s by -F), and only consider the basename, and see how many instances exist of it, and where (all duplicate instances by -D). Input: folder a<TAB>file 1 folder b<TAB>file 1 folder b<TAB>file 2 folder c<TAB>file 3 Commandline: cat sample.txt | guniq -D -F "\t" -f 1 Output: folder a<TAB>file 1 folder b<TAB>file 1 BENEFIT: If you can define the separator character (i.e. TAB), then you have the freedom to have all other characters besides SEP within your column data, i.e. your column could then contain SPACE characters. --- FEATURE SUGGESTION #2 --- --consider-fields=a[,b,c, ...] Build the comparison string of a line from these field(s). --ignore-fields=x[,y,z,...] Build the comparison string of a line by excluding these field(s). EXAMPLE: Input: folder a<TAB>file 1<TAB>suffixA folder b<TAB>file 1<TAB>suffixB folder b<TAB>file 2<TAB>suffixA folder c<TAB>file 3<TAB>suffixA Commandline: cat sample.txt | guniq -D -F "\t" --consider-fields="2" Equivalent to: cat sample.txt | guniq -D -F "\t" --ignore-fields="1,3" Output: folder a<TAB>file 1<TAB>suffixA folder b<TAB>file 1<TAB>suffixB WORKAROUND MEANWHILE: Pre-insert a RegEx find/replace process in the pipe before uniq, which brings all the comparison-ignored data to the front, and then --skip-fields. BENEFIT: Of course it would be much more convenient to work with the data as-is, and have the functions --consider-fields and --ignore- fields. Regards, Stefan Nowak
Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.427 (Entity 5.427) Content-Type: text/plain; charset=utf-8 X-Loop: help-debbugs@HIDDEN From: help-debbugs@HIDDEN (GNU bug Tracking System) To: Stefan Nowak <p.org@HIDDEN> Subject: bug#7068: Acknowledgement (Feature request: uniq --field-separator="SEP" --consider-fields="a, b, c" --ignore-fields="x, y, z") Message-ID: <handler.7068.B.128485097816773.ack <at> debbugs.gnu.org> References: <016CD1D6-E98C-449C-BAAB-EB698D0C2B0F@HIDDEN> X-Gnu-PR-Message: ack 7068 X-Gnu-PR-Package: coreutils Reply-To: 7068 <at> debbugs.gnu.org Date: Sat, 18 Sep 2010 23:03:02 +0000 Thank you for filing a new bug report with GNU. This is an automatically generated reply to let you know your message has been received. Your message is being forwarded to the package maintainers and other interested parties for their attention; they will reply in due course. Your message has been sent to the package maintainer(s): bug-coreutils@HIDDEN If you wish to submit further information on this problem, please send it to 7068 <at> debbugs.gnu.org. Please do not send mail to help-debbugs@HIDDEN unless you wish to report a problem with the Bug-tracking system. --=20 7068: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D7068 GNU Bug Tracking System Contact help-debbugs@HIDDEN with problems
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997 nCipher Corporation Ltd,
1994-97 Ian Jackson.