En Thu, 15 May 2008 06:02:29 -0300, Beema shafreen <[EMAIL PROTECTED]> escribió:

I am comparing two files A and B
which has three columns a1, b1 of A and a2, b2

*three* columns? You menction only two of them.

say for example if need to compare a1 with a2 and if there are common i have
display a1, b1, b2
or else i have to display a1 , b1 or a1, b2

Do you have to syncrhonize both listings? That is, search for matches that are not in the same line? Or just compare line by line? In the first case, the difflib module may help: http://docs.python.org/lib/module-difflib.html In the second case, just iterate over both files, compare lines and display one thing or another.

is the set function going to be the best option or is there any other way

Probably the set type won't be useful - a concrete example of what you want would help to provide better ideas.

--
Gabriel Genellina

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to