|
Note: This is a single entry from my online diary. Please note that I'm not always entirely serious and some entries probably won't make sense unless put in context with other entries. |
|
The other day one of my coworkers pointed out a Unix text manipulation command that I hadn't known existed.
It's named "join". It does more or less the same thing as select/joins do in the SQL world, it merges together lines from two text files into a single stream, based on a keyword found in each line.
So joining on the first column:
bre Bjarni
are Andri
mar Már
gaur Gaurinn
with
bre Ireland
bre Iceland
are Iceland
mar Iceland
will output
bre Bjarni Ireland
bre Bjarni Iceland
are Andri Iceland
mar Már Iceland
Isn't that just great? Join is my new favorite Unix command!
Another interesting command revealed to me at the same time was "comm", but I don't think it's nearly as cool.