Page 1 of 1

what words are different?

Posted: Fri Jun 16, 2006 1:31 am
by jack99999
i sometimes want to compare the contents of two files to check the differences between words. i don't care about any layout whatsoever.

these could be a text file and a similar one that has been reformatted. or text taken by cutting from a web page compared with text extracted from a word document.

it would be nice to have a compare option that would just treat the documents as streams of text, ignoring all space and carriage returns. the result would then show what content had changed, ignoring any layout.

of course there may already be an option to do this that i haven't found...


jack
dangerously dependent on his charisma

Posted: Fri Jun 16, 2006 5:14 pm
by psguru
No, there's no such option. But it can be done with the help of plug-ins and synchronized word wrap.

First, you need a plug-in (a console application capable of processing files) that would strip line feeds and carriage returns from your files. For example, you could use a Perl script, such as:

Save the following lines in Strip-LF-CF.pl file:

Code: Select all

#!/usr/local/bin/perl
$/ = undef;
$_ = <>;
s/\s+/ /g;
print;
Then define the following plug-in (obviously, your file locations and extensions will be different):

Name: Strip CR-LF
Extensions: *
Application: C:\Perl\bin\perl.exe
Arguments: C:\Strip-CR-LF.pl $INPUTFILEPATH

After the comparison is done, you'll see that both files are now represented by single lines. Now use View | Enable Word Wrap command to wrap the results.

Posted: Fri Jun 16, 2006 9:46 pm
by jack99999
superb :)

that works very nicely. i've never used plugins before.


incidentally, a couple of bugs in my Examdiff 3.2c version:
  • my list of plugins does not show any text, even though i completed all the fields when creatgin the plugin. so all i get is a checkbox in the list.
  • on the Plug-in Details page there is a typo: 'do not surround ExamDiff Pro arguments with qoutes'

many thanks


jack
dlrow dednah-thgir a ni tfirda

Posted: Fri Jun 16, 2006 10:11 pm
by psguru
No problem.

The bugs you mentioned have been fixed in 3.3 and 3.4.

Posted: Sat Jun 17, 2006 12:08 am
by jack99999
ok

thanks

jack
Good Morning! said Bilbo, and he meant it