I am looking for a fast filter that will take a text file on standard input, hash each line up to the first tab character, and put the line into a different file depending on the hash value (modulo some number of files). For example, something like:
$ cat > foo a 1 b 2 c 3 d 4 ^D $ hashit -o bar -n2 < foo $ cat bar.0 b 2 $ cat bar.1 a 1 c 3 d 4
The hash function must be consistent between invocations.
This is somewhat like the standard
split utility, but I want to split on the hashed content of lines, not simply the number of lines per component.