Crates.io | anewer |
lib.rs | anewer |
version | 0.1.6 |
source | src |
created_at | 2020-11-11 03:33:26.335875 |
updated_at | 2021-09-13 13:48:04.681273 |
description | anewer appends lines from stdin to a file if they don't already exist in the file. You could also use it as `uniq` without `sort`. |
homepage | https://github.com/ysf/anewer |
repository | https://github.com/ysf/anewer |
max_upload_size | |
id | 311074 |
size | 50,505 |
anewer appends lines from stdin to a file if they don't already exist in the file. You could also use it as uniq
without sort
. This is a rust version of tomnomnom/anew. It makes use of tkaitchuck/aHash to cut down runtime to ~50%. Since only hashed lines are held in memory, it cuts down memory usage for inputs with long lines. Which is similar how huniq
works.
$ anewer -h
USAGE:
anewer [FLAGS] [filename]
FLAGS:
-n, --dry-run Dry run, will leave the file as it is
-h, --help Prints help information
-v, --invert Invert the sense of matching
-q, --quiet Quiet, won't print to stdout
-V, --version Prints version information
ARGS:
<filename>
cargo install anewer
$ cat things.txt
Zero
One
Two
$ cat newthings.txt
One
Two
Three
Four
$ cat newthings.txt | anewer things.txt
Three
Four
$ cat things.txt
Zero
One
Two
Three
Four
$ cat list.txt
One
One
Two
Two
Three
Four
Three
Four
$ cat list.txt | anewer
One
Two
Three
Four
GPLv3+