How should I compare two txt files separately coming from windows/dos and linux/unix

Piet van Oostrum piet at cs.uu.nl
Sat Jun 13 04:46:09 EDT 2009


>>>>> Emile van Sebille <emile at fenx.com> (EvS) wrote:

>EvS> On 6/11/2009 12:09 AM higer said...
>>> Tool can certainly be used to compare two files,but I just want to
>>> compare them using Python code.
>>> 

>EvS> difflib?

If I understand correctly the OP just wanted to know whether two files
were equal, not what the differences would be. In that case difflib is
overkill. 

On the other hand `equal' has many meanings. Ignoring line endings is
one option, ignoring trailing whitespace could be another one. Yet
another one could be normalizing the character encoding, etc.
-- 
Piet van Oostrum <piet at cs.uu.nl>
URL: http://pietvanoostrum.com [PGP 8DAE142BE17999C4]
Private email: piet at vanoostrum.org



More information about the Python-list mailing list