Suppose I have two files that look like this:
File 1:
1 x
2 y
3 z
5 l
File 2:
1 a
2 b
4 c
5 c
And I want to join them using the first column as a key to give
1 x a
2 y b
3 z
4 c
5 l c
where a missing line in one file just means that I omit its data. I thought join
would do the trick, but it seems to insist on skipping any line that doesn't appear in both files and I can't find an option to make it do otherwise. AT least -e
didn't work how I thought it would. What's the right command line way to do this?