I am looking for some python script to compare two files

M

Miki Tebeka

Hello david,
The file can be PDF or Word format. Any help?
If just like to know if they differ you can compare their md5 signature (or
any other digital signature).

If you want a real diff then convert them to text.
* For PDF you can use pdftotext (comes with xpdf) or Acrobat COM object (if
you're on windows). There are also some commercial pdf2txt programs.
* For word you can use antiword and friends and again the word COM object
if you're on windows.

See the diffutils package for diffing text files.

HTH.
--
------------------------------------------------------------------------
Miki Tebeka <[email protected]>
http://tebeka.bizhat.com
The only difference between children and adults is the price of the toys

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Cygwin)

iD8DBQFDcaVV8jAdENsUuJsRAvP/AJ43qqe4Z1roQOklxodhtqZtjmcAcQCeNLN9
bMAQZ23sJCewCYW53CcVjdw=
=ycXe
-----END PGP SIGNATURE-----
 
D

Dennis Lee Bieber

hi:

The file can be PDF or Word format. Any help?
Install an ASCII-only print driver
Print "to file" using this driver
Compare text files.

PDF is a variation of PostScript -- that is, the contents are a
specially optimized programming language for rendering text. The text
could be identical but all the code surrounding it could be different.
(I've seen PostScript drivers for word processors vary between passing a
single line of text to a function that then character spaced the text
for justification, vs another that computed starting locations for each
word, passing words to the rendering function).

Word documents, too, could "look" identical when printed, but be
completely different internally. Word files may have things like linked
sections as one has edited, and remnants of such things as unused style
tags.

--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top