I would check out the 'join' utility. If you have two files, A and B, comma-delimited, they are -sorted- (see the sort utility), and you want all lines that have the first column in common, then: join -j 1 -t ',' A B
This ought to work fine! Then just iterate across all of the files, iterating as suits you best.
Mark
Comment on Re: How to combine multiple files together
This is almost good, however I do not want repeated lines. so if file B has multiple instances of Column 1 of file A, I want it just simply printed continuously, no line breaks. However I will still have to stick to Perl, because this will be an adon to a another script.