Lad wrote:
> Hi,
> What is the best method for comparing two files by words?
try the difflib module:
http://www.python.org/doc/2.4.1/lib/module-difflib.html
--
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in '[EMAIL PROTECTED]'.split('@')])"
--
On Friday 01 July 2005 04:39 am, Lad wrote:
> Hi,
> What is the best method for comparing two files by words?
> I was thinking about reading files by words and compare them but a word
> in one file can be linked with a new line character ( \n)
> and this '\n' will cause that the words will consider
Lad wrote:
> Hi,
> What is the best method for comparing two files by words?
> I was thinking about reading files by words and compare them but a word
> in one file can be linked with a new line character ( \n)
> and this '\n' will cause that the words will considered to be
> different( eventhough
you could always just remove those special characters (\n \t ..),
remove spaces, read both files and compare string. I don't this is the
best way of doing this... but maybe a combination of this way and yours
will be efficient enough - remove all problematic characters and then
compare line by line
Hi,
What is the best method for comparing two files by words?
I was thinking about reading files by words and compare them but a word
in one file can be linked with a new line character ( \n)
and this '\n' will cause that the words will considered to be
different( eventhough without '\n' are the sa