[Date Prev][Date Next][Subject Prev][Subject Next][ Date Index][ Subject Index]

Re: Much easier way to do file comparison



** Reply to message from Harry Binswanger  on Sun, 06 Nov 2005
02:13:22 -0500

Harry:

Here's an adaptation, fully commented, that implements your ideal of being able
to look at just one of the two documents and see the differences (without
having to toggle back and forth between two documents to make visual
comparisons) -- but this implementation really does display *all* the
differences -- not just the differences in *one document only*. Added edits in
Doc #1 are displayed (in Doc #1, which is the only doc you need to look at) in
*green*, differences with Doc #2 are displayed (also in Doc #1) in *red*.

The big practical problem with your scheme is how intrusive it is. It makes a
mess out of Doc #1 -- presumably you're prepared to remove your  and
 codes manually, or do something with them, heaven knows what -- but
this result at least is accurate and meaningful. If you don't want to know how
Doc #2 actually differs, then what that really means is that you accept Doc #1
as your preferred version, and hence there's no reason to compare.


XPLeNCODE v2.0
b-gin [UNTITLED]
{<}SX01,2{>}{<}SV02,FIRST{>}{<}CUB,01{>};*; CountUp loop, exe
cuted 2 times per value in , between  and 
[cr|lf];*;[cr|lf]{<}SU03,{<}SX04,{<}IS02{>}+" file to compare
? (Y/n)"{>}{>}{<}GT03{>}{<}PR@04{>}{<}SX04,{<}RC{>}{>}{<}IF@U
PR({<}IS04{>}){240}"N"{>};*; If Aborting...[cr|lf];*;[cr|lf]{
<}IF{<}IS02{>}{240}"E"{>};*; If "sEcond" window displayed...[
cr|lf];*;[cr|lf]{<}LBA{>}[AS_][TF_][WG_][AS_]{<}EI{>}{<}EX{>}
{<}EI{>};*; Abort[cr|lf];*;[cr|lf][YD_][XD_][XP_][TF_][SI_][D
O_][FF_][AS_]{<}SV02,SECOND{>}{<}LBB{>};*; End of CountUp loo
p[cr|lf];*;[cr|lf]{<}SX02,{<}VA$MA{>}{>}[BX_]d MA=1{>}[Q2_];*
; Set FD/FM "MAtch" sensitivity to 1 character[cr|lf];*;[cr|l
f]{<}LBC{>};*; Beginning of main FD/FM compare loop[cr|lf];*;
[cr|lf]{<}IF{<}VA$FE{>}<1{>}[FD_]{<}MD+26{>};*; Find differen
ces in Doc #1, begin to display them GREEN[cr|lf];*;[cr|lf][A
S_][DF_];*; Start DeFining differences in Doc #2[cr|lf];*;[cr
|lf][AS_][FM_]{<}MD-26{>};*; End of differences in Doc #1, qu
it GREEN[cr|lf];*;[cr|lf][AS_][DF_]{<}IF{<}VA$DS{>}<{<}VA$DN{
>}{>};*; Toggle to Doc #2, stop DeFining text, see if the DF{032}
block has any length (i.e. differences exist)...[cr|lf];*;[cr
|lf][AS_]{<}MD+20{>}[CP_]{<}MD-20{>};*; If there *are* differ
ences in Doc #2, CoPy them to Doc #1 and display them in RED[
cr|lf];*;[cr|lf][AS_]{<}EI{>}[XD_][AS_]{<}GLC{>}{<}EI{>};*; E
nd of main FD/FM compare loop[cr|lf];*;[cr|lf][BX_]d MA={<}PV
02{>}[Q2_];*; Restore original "MAtch" sensitivity[cr|lf];*;[
cr|lf][TF_][WG_]{<}GLA{>} Share identical code at [cr|lf
]
-nd
XPLeNCODE

-----------------------------
Robert Holmgren
holmgren@xxxxxxxx
-----------------------------