commit 43696817e24a180b4b04cf22b172d5e93ec78395
parent 9fe96f3628e998e4a677448580a164b614d3119e
Author: Morel BĂ©renger <berenger.morel@neutralite.org>
Date: Mon, 17 Feb 2020 06:16:12 +0100
wrote a small README
Diffstat:
A | README | | | 39 | +++++++++++++++++++++++++++++++++++++++ |
1 file changed, 39 insertions(+), 0 deletions(-)
diff --git a/README b/README
@@ -0,0 +1,39 @@
+This tool merges sequential entries if they have some fields with same values.
+
+It's only mandatory argument for now is the FIELDS environment variable, which
+is used to know which fields are to be exact in order to be merged.
+*All* fields must match, otherwise entries will not be merged.
+Entries needs to be sorted on those fields in order to be merges.
+
+FIELD_SEP is an environment variable that allows one to define the list of
+characters that will be considered as fields delimiters. Each character will be
+a field delimiter (UTF-8 not supported for now). By default, field separators
+are space (" ", 0x20) and horizontal tabulation ("\t", 0x09).
+
+Entries are defined in the environment variable ENTRY_SEP, and is the line feed
+character ("\n", 0x0A) by default. This is not tested though, so it is probably
+safer to stay with the default, which is anyway used by most if not all other
+command-line tools.
+
+This is a work in progress tool, but it works for me.
+
+Example of usage:
+
+```sh
+FIELD_SEP=": \t" FIELDS="1,3" ./merge <<EOF
+0 foo:hello:1
+1 bar:hello:2
+ 2:foo:world:3
+ 2:bar:world:4
+EOF
+```
+
+This is a single file project, at least for now, so to use it, well, just use
+your favorite C++ compiler and run the resulting binary with some path
+information, for example:
+
+```sh
+clang++ merge.cpp -o merge && FIELDS="1" ./merge < foo.data
+```
+
+A Makefile should be writen, someday. Same for a real man-page.