The typical way to solve such a problem is to use a hash to store the content of the files, with the (first) common column being the hash key and the rest of the lines the hash values (you'll need to concatenate the lines into the hash values). Once you've read all the files one by one and store their contents into the hash, simply output the hash keys and values.
Update: Fixed typo: s/One/Once/
Comment on Re: merge multiple files based on a common column and each having 2k-3k columns
Replies are listed 'Best First'.
A reply falls below the community's threshold of quality. You may see it by logging in.