- Notifications
You must be signed in to change notification settings - Fork4
anewer appends lines from stdin to a file if they don't already exist in the file. This is a rust version ofhttps://github.com/tomnomnom/anew
License
NotificationsYou must be signed in to change notification settings
ysf/anewer
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
anewer appends lines from stdin to a file if they don't already exist in the file. You could also use it asuniq
withoutsort
. This is a rust version oftomnomnom/anew. It makes use oftkaitchuck/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 howhuniq
works.
$ anewer -hUSAGE: 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 informationARGS: <filename>
cargo install anewer
$ cat things.txtZeroOneTwo$ cat newthings.txtOneTwoThreeFour$ cat newthings.txt | anewer things.txtThreeFour$ cat things.txtZeroOneTwoThreeFour
$ cat list.txtOneOneTwoTwoThreeFourThreeFour$ cat list.txt | anewerOneTwoThreeFour
GPLv3+
About
anewer appends lines from stdin to a file if they don't already exist in the file. This is a rust version ofhttps://github.com/tomnomnom/anew