in reply to concatenation of lines from two different files

(shameless plug for a tool that I wrote :) This sort of "flat file join" is the kind of thing I've had to do quite often over the years -- not just the intersection on a key field, like you're doing, but also unions and diffs, with flexible field delimiters (regex) and flexible output.

So I wrote my own generalized command-line tool to do this, and have been adding features every now and then. It's posted here: cmpcol (and I've just updated that node to include stuff I've added to the script since the original posting).

Given your two data files (call them t1 and t2), I can generate the output you specified with this command line:

cmpcol -i -lb -d \; t1:2 t2
Where: