kybin / rdup

Remove adjecent duplicated lines from stdin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

rdup

Remove adjecent duplicated lines from stdin. Use it with pipe.

usage

cat log.txt
[error] [00:00:00] hello
[error] [00:00:00] hello
[error] [00:00:00] hello
[error] [00:00:00] world
[error] [00:00:00] world
[error] [00:00:00] world
[error] [00:00:00] hello
[error] [00:00:00] world

# rdup will remove adjecent duplicated lines.
cat log.txt | rdup
[error] [00:00:00] hello
[error] [00:00:00] world
[error] [00:00:00] hello
[error] [00:00:00] world

# -n flag will let rdup remeber multiple lines.
cat log.txt | rdup -n=2
[error] [00:00:00] hello
[error] [00:00:00] world

About

Remove adjecent duplicated lines from stdin


Languages

Language:Go 100.0%