views:

47

answers:

1

Suppose I have one file A which is a list with a two-digit key numbers and three-digit subject numbers. Now suppose I have a second file B containing a list of pairs of subject numbers. I want to substitute in key numbers for pair numbers in file B.

My question is, what is the right UNIX tool for this substitution list job? Can it be elegantly done with tr? How about sed? Examples of the right solution are (of course) welcome.

+2  A: 

Short answer: the (Linux) manual page for join(1) should contain enough information to get this done.

Michiel Buddingh'
Don't forget to `sort` the files on the join field first.
Reuben Peeris