https://github.com/kometen/compare
Compare sets and print result to console
https://github.com/kometen/compare
hashmap intersection rust symmetric-difference
Last synced: 12 months ago
JSON representation
Compare sets and print result to console
- Host: GitHub
- URL: https://github.com/kometen/compare
- Owner: kometen
- License: mit
- Created: 2020-03-29T00:08:54.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2024-11-12T16:51:01.000Z (over 1 year ago)
- Last Synced: 2025-01-11T01:14:57.836Z (about 1 year ago)
- Topics: hashmap, intersection, rust, symmetric-difference
- Language: Rust
- Size: 18.6 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# compare
Compare sets and print result to console
This will read a text-file and split it using a delimiter. It will either show
[i] intersection (in all sets) or [s] symmetric difference (only in one set).
A text-file in CSV-format is what I had in mind when I began coding it but can be
used for any text-file. If the delimiter is found and the column is within bounds
it can do some work.
Example where delimiter is semicolon (;), column is two (2) and operation is
first intersection (i) and secondly symmetric difference (s).
$ cat a.csv
1;a;one
2;b;two
3;c;three
4;d;four
5;e;five
$ cat b.csv
3;c;three
4;d;four
5;e;five
6;f;six
7;g;seven
$ compare -f a.csv -f b.csv -d ';' -c 2 -o i
five
four
three
$ compare -f a.csv -f b.csv -d ';' -c 2 -o s
one
six
seven
two
Can use three or more files for comparison.
$ cat c.csv
5;e;five
6;f;six
7;g;seven
8;h;eight
9;i;nine
$ compare -f a.csv -f b.csv -f c.csv -d ';' -c 2 -o i
five
To build it use 'cargo build' or 'cargo build --release'.