in reply to script to merge files
If your two input files have just the vertical-bar character as the column delimiter (without spaces), then this command line:
would produce output like this:cmpcol -i -lb '|' -d '|' file1:2 file2:2
(that is, if there are in fact just those three lines that involve matching verbs). If the data files have spaces around the vertical bars, just include those in the command-line option values.goes|go|went|go sees|see|saw|see eats|eat|ate|eat
Then all you have to do is re-arrange the columns to suit your taste:
(The quote-mark usage above is based on using a bourne/bash shell.)cmpcol -i -lb '|' -d '|' file1:2 file2:2 | perl -F'\|' -lape '$_=join +"|",@F[1,0,2]'
|
|---|