.oj off
.fo 1989-04-26           COMPARE users guide          Page #















                          Ã Ï Í Ð Á Ò E

                    

                       Texô comparisoî tooì 

                              

          
                           Useró Guide
                               by
                          Leiæ Nielsen
                          Jydsë Telefon
                       Erhvervsafdelingen
                        Datanetsektionen

.paŠ1® Introduction

COMPARÅ wilì examiî twï texô fileó anä så iæ theù containó thå �
samå information.
Iæ not¬ thå differenceó wilì bå printed.

Iæ twï lineó contaiî thå samå "real¢ information¬ buô onå oæ thå �
lineó havå extrá spaceó added¬ theî COMPARÅ wilì normalù supresó �
thaô difference¬ unless it ió instructeä otherwise.

COMPARÅ maù alsï bå instructeä tï poinô ouô differences¬ bù placinç �
á pointer undeò each character whicè doeó noô match® Thió optioî �
ió onlù usefull¬ iæ thå fileó arå nearlù alike.

COMPARÅ trieó tï regaiî syncronisation¬ iæ oî oæ thå fileó �
contaiî somå lines¬ whicè arå noô pressenô oî thå otheò file® Onå �
oæ thå parameteró tï COMPARÅ ió thå numbeò oæ lineó whicè musô �
match¬ beforå syncronisatioî ió reestablished.
  

2® Parameters

COMPARE is called as follows:

  COMPARE <text file 1> <text file 2> [<option> ... ]


where

<text file 1>:   Is the name of the file containing the first
                 file to be compared.

<text file 2>:   Is the name of the file containing the second
                 file to be compared.



<Option>:        Is one of the following:  /l: /m: /t: /x:
 

/Lines:<integer> 
                Determins the number of lines which must match                before the files are considdered to be like                again, after a missmatch has occcured.
                Default /l:6
               
/Mark:{ on | off }
                Mark Unequal Columns, by writing pointers to the 
                differences in two lines. Only usefull if the files 
                are almost identical.
                Default /m:off
               
/Trailing:{ on | off }
                Ignore trailing blanks.  Trailing blanks are                 ignored, if this option is set.
                Default /t:on    

/Xray:{ on | off }
                Produce small test output.
                Default /m:off
                 
Š
3® Restrictions

COMPARÅ useó internaì linå buffers¬ anä musô seô á limiô oî linå �
lengths® Iæ á longeò linå ió read¬ á warninç ió given¬ buô onlù �
thå firsô parô oæ thå linå ió matched.
Currentlù thå linå lengtè ió 14° characters.

Aó COMPARÅ useó thå heað tï storå lineó wheî syncronizing¬ therå �
ió á chancå thaô COMPARÅ wilì ruî ouô oæ storage® Iæ thió �
happens¬ á warninç ió printged¬ anä thå prograí ió terminateä aô �
thaô point.


4® History

Thió prograí firsô appeareä iî
     Pascaì Newó £ 12¬ Junå 1978¬ pagå 2° ff®
Thå authoò includeä thå folowinç information¬ reprinteä froí thå �
letteò attacheä tï thå prograí listning:

----------------------------------------------------------------
COMPARÅ ­ Comparå twï texô files anä reporô theiò differences®

Copyrighô (C© 1977¬ 197¸
James F® Miner
Sociaì Science Researcè facilitieó Centeò
Universitù oæ  Minnesota

Generaì permissioî tï makå faiò uså iî noî-profiô activitieó oæ �
alì oò parô oæ thió materiaì ió granteä provideä thaô thió noticå �
ió given® Tï obtaiî permissioî foò otheò useó and/oò machinå �
readablå copieó writå to:

         Thå Directoò
         Sociaì Sciencå Researcè Facilities Centeò
         2µ Blegeî Halì                  
         26¹ l9tè Ave® So.
         Universitù oæ Minnesotá
         Minneapolis¬ Minnesotá  5545µ
         U S Á

Comparå ió useä tï displaù oî "Output¢ thå differenceó�
betweeî twï similaò texts ("Filea¢ anä "Fileb")® Notable
characteristicó areº

­ Comparå is linå oriented® The smallesô uniô oæ comparisoî�
  ió thå texô line (ignorinç trailinç blanks)®  Thå presenô�
  implementatioî haó á fixeä maximuí line length®

­ Bù manipulatinç á program parameter¬ thå useò caî affecô�
  Compare'ó sensitivitù tï thå "locality¢ oæ differences®�
  Norå specificallù thió parameter¬ "Minlinesformatch"®�
  specifieó thå numbeò oæ consecutive lines oî each filå�
  whicè musô matcè iî ordeò thaô theù bå considereä as�
  terminatinç thå prioò mismatch®   Á largå value of�
  "Minlinesformatch¢ tendó to producå fever buô largeò�
  mismatcheó thaî doeó á smalì value®  Thå valuå siø appears�
  tï givå gooä results oî pascaì sourcå files buô may bå�Š  inappropriatå foò otheò applications®

  Iæ comparå is tï bå  useä aó a generaì utilitù program¬�
  "Minlinesformatch¢ shoulä be treateä as a program�
  parameteò  oæ somå sort®  Iô is declareä as a constanô here�
  foò  portability's sake®

 ­ Comparå employs a simplå backtrackinç searcè algorithm tï�
   isolatå mismatches from theiò surroundig matches® This�
   requires (heap© storage roughlù proportionaì to thå sizå�
   oæ thå largesô mismatch¬ anä timå roughlù proportionaì tï�
   thå squarå oæ thå size oæ thå mismatch foò eacè mismatch®�
   Foò this reason iô maù noô bå feasiblå tï uså Comparå oî�
   files vitè verù long mismatches®

 ­ Tï thå besô oæ thå author's knowledge¬ Comparå utilizeó�
   onlù features oæ standarä pascal®�
----------------------------------------------------------------


Anotheò author¬ Willetô Kemptoî froí Universitù oæ California¬ �
Beòkeley¬ U.S.A®  publisheä aî extensioî tï thå program¬ iî 
Pascaì Newó #1µ Septembeò 197¹ p® 2¸ ff.
Hå includeä thå letteò reprinteä here:

----------------------------------------------------------------
   Dear Jim¬

Youò comparå prograí replaceä á morå primitivå onå writteî herå �
anä haó beeî very helpful® Iô raî withouô modificatioî oî botè �
ouò PDÐ 1± (UNIX© anä CDÃ 640° systems¬ anä witè minoò �
modificationó now runó oî ouò DG ECLIPSÅ AOÓ (P4 Pascal© system.

É encloså twï mods whicè É believå arå wortè makinç tï thå �
distributioî version; theså 1© pluç á hole¬ anä 2) makå iô morå �
usefuì foò datá files® Morå specifically:


1© Iæ thå originaì versioî sayó "Nï differences"¬ yoõ cannoô �
count oî thå fileó beinç thå same® They maù contaiî lineó longeò �
thaî Linelength, anä lines arå not checkeä pasô thaô point® Á �
checë anä warninç arå addeä in thå encloseä version.


2© Thå originaì outpuô displaù waó finå foò prograí sourcå files® �
buô verù pooò foò fixeä formaô datá fileó (whicè presumablù �
abounä iî á Sociaì Sciencå Researcè Facilitieó Center)® Thå �
modifieä versioî pairó mismatcheä lineó anä pointó ouô �
differenceó witè aî arrow¬ Iô Onlù doeó thió iæ thå mismatchinç �
sectionó arå thå samå numbeò oæ lineó (usuallù one© oî eacè file® �
Thå outpuô waó alsï madå á littlå morå compact¬ despitå thå facô �
thaô iô no÷ containó morå information® Thió maù seeí like a frilì �
if yoõ haven'ô haä tï worë witè lonç datá files, buô iô saveó �
considerable timå anä keepó ouò coderó froí going blind® Iô doeó �
noô seem particularlù usefuì foò sourcå prograí files, anä caî bå �
turneä ofæ bù seteinç á constanô FALSE.

Tï facilitatå inspectioî oæ theså mods¬ I encloså ouò completå �
modifieä version¬ anä outpuô COMPAREinç thå versioî publisheä iî �ŠPASCAÌ NEWS (filå a© vitè ouò versioî (filå b©® Tï seå itó uså �
oî datá files, É alsï encloså outpuô froí onå oæ ouò �
applicationó® Together, these modó increaså thå lengtè oæ the �
source program abouô 15%¬ anä seem tï havå nï appreciablå effecô �
oî executioî time.

Thank yoõ foò makinç thió softwarå available tï the pascaì useò �
community® É hopå yoõ finä thå encloseä material oæ use.
----------------------------------------------------------------


Hanó J›rgeî Jakobseî ¨ JTAÓ © retypedå thå prograí (includinç thå �
addition)¬ anä modifyeä thå prograí tï uså Borlanä TURBÏ Pascal® �
Hå alsï includeä á betteò parameteò processing¬ whicè waó finalù �
improveä bù Leiæ Nielsen¬ JTAS.

