LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-04-2005, 03:54 AM   #1
Megasms
LQ Newbie
 
Registered: Nov 2005
Location: India
Posts: 7

Rep: Reputation: 0
Compare two .doc file in c++ program


hi

I want to open two .doc [ms-word] files in cpp program using fstream.
and compare two files contents for every character or every line and display the out put both files are equal or not.

when i tried to open a .doc file and display the contents in cpp program it converted to the machine language and give the message is both files are not equal.

and i need this solution in php.

in php i tried it compare the .doc file properties like created date time and author name and display files are not equal, it does not compare the contents of the file. i need to compare only contents.

please give the solutions.

Thanks for advance

cheers
Megasms
 
Old 11-04-2005, 06:05 AM   #2
fvgestel
LQ Newbie
 
Registered: Oct 2005
Location: Netherlands
Posts: 21

Rep: Reputation: 15
try using CRC or MD5 checksums :

Code:
$file_string = file_get_contents($file);
$crc = crc32($file_string);
now compare the checksums of both files
 
Old 11-04-2005, 09:14 PM   #3
Megasms
LQ Newbie
 
Registered: Nov 2005
Location: India
Posts: 7

Original Poster
Rep: Reputation: 0
Thanks for your reply,

but i confusing in which c++ or php please explain briefly

and give the code..

Thanks for advance...
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
php read from file and compare. xushi Programming 11 07-14-2005 01:10 PM
Script to check Doc-BBB against Doc-AAA for inconsistence satimis Programming 2 11-09-2004 01:43 AM
.doc file to pdf GtkUser Linux - General 2 02-05-2003 02:55 AM
Is there any *FILE CONTENT COMPARE* tool in Linux? yuzuohong Linux - General 3 07-14-2002 06:11 AM
file compare program Nyc0n Linux - General 4 08-18-2001 09:08 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:54 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration