νάρθηξ - narthex

Modular personalized dictionary generator - [git] - [github] - [license] - by Michael Constantine Dimopoulos - <mk@mcdim.xyz>


ninc

Ninc reads from standard input and, after printing the dictionary as is, it prints the lines multiplied with the difference of max-min, and appends n to each line, where n is increased after every line from min to max inclusive. It prints to standard output.

For example, with the following command
$ cat words.txt | ninc 1 3
where words.txt contains this:
dog
cat
fish
the program will produce this:
dog
cat
fish
dog1
dog2
dog3
cat1
cat2
cat3
fish1
fish2
fish3
It can also be used to append years or popular numbers like 69.

Additionally, you can set some delimiters with the -d option. For example:

$ echo "milk\nyogurt" | ninc 1 2 -d .-
milk
yogurt
milk1
milk2
yogurt1
yogurt2
milk.1
milk.2
yogurt.1
yogurt.2
milk-1
milk-2
yogurt-1
yogurt-2

Notice: by default, it does not append to numerical lines. To change this you can use the -n flag.