On Wed, Dec 5, 2012 at 10:57 AM, Daniel Doo <d...@topekacapitalmarkets.com> 
wrote:
> I am new to Python.  Is there a method to “join” two pipe delimited files
> using a unique key that appears in both files?  I would like to implement
> something similar to the Unix join command.

If the files are small enough to fit in virtual memory, load one of
the files into a dict where the key is the join field and the value is
the full line.  Then iterate over the other file one line at a time,
checking to see if the join field is in the dict.  If it is, output
the joined line.  Otherwise, skip it.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to