GNU bug report logs - #44704
uniq: replace repeated lines with a message about how many repeated lines

Previous Next

Package: coreutils;

Reported by: "Brian J. Murrell" <brian <at> interlinx.bc.ca>

Date: Tue, 17 Nov 2020 14:14:01 UTC

Severity: wishlist

Tags: notabug

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: "Brian J. Murrell" <brian <at> interlinx.bc.ca>
To: bug-coreutils <at> gnu.org
Subject: uniq: replace repeated lines with a message about how many repeated
 lines
Date: Tue, 17 Nov 2020 08:32:36 -0500
[Message part 1 (text/plain, inline)]
It would be a useful enhancement to uniq to replace all lines
considered non-uniq (i.e. those that would be removed from the output)
with a message about how many times the previous line was repeated.

I.e.

$ cat <<EOF | uniq --replace-with-message '[previous line repeated %d times]'
first line
second line
repeated line
repeated line
repeated line
repeated line
repeated line
third line
EOF
first line
second line
repeated line
[previous line repeated 4 times]
third
line

Cheers,
b.


[signature.asc (application/pgp-signature, inline)]

This bug report was last modified 4 years and 272 days ago.

Previous Next


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