Fedora Linux Support Community & Resources Center
  #1  
Old 8th November 2004, 05:34 PM
satimis Offline
Registered User
 
Join Date: Jul 2004
Posts: 1,386
Script to check Doc-BBB against Doc-AAA for inconsistence

Hi folks,

I'm going to make a script checking inconsistence on 2 documents

Doc-BBB is reproduced from Doc-A, (original document) not with 'copy and paste' command.

Making it simple first, as highlighted in following example, an one line document:-

Doc-AAA
Code:
Check this link to sea what scannars are supported by SANE
Doc-BBB
must be reproduced exactly the same as Doc-AAA, disregarding the typing mistake (spelling mistake)
sea = should read “see”
scannars = should read “scanners”
in order to make sense.

That is to check Doc-BBB to be 100% consistent to Doc-AAA even spelling mistake existing. If a mistake is found on Doc-BBB the mistake will be printed out in pair, such as;

Code:
Doc-AAA   Doc-BBB
sea       sei
character “i” will be highlighted or changed to another colour and its line number and word number also indicated..

Can any folk shed me some light how to start?

TIA

B.R.
satimis
Reply With Quote
  #2  
Old 8th November 2004, 10:14 PM
Jman Offline
Registered User
 
Join Date: Mar 2004
Location: Minnesota, USA
Age: 27
Posts: 7,909
Start with the diff command. It compares two files. If they were supposed to be exactly alike, any differnences will be outputted.

See
Code:
man diff
for the documentation.
Reply With Quote
  #3  
Old 9th November 2004, 07:45 AM
satimis Offline
Registered User
 
Join Date: Jul 2004
Posts: 1,386
Hi Jman,

Tks for your advice. Test performed as follows;

1)
Original document "doc_a"
Code:
Check this link to sea what scannars are supported by SANE
Already having 2 typing mistakes
sea
scannars

2)
But the reproduced document "doc_b" must maintain these 2 mistakes for consistence.
Code:
check thes link to sea what scannars are suppurted by SeNE
Unfortunately another 3 typing mistakes were further made;
thes
suppurted
SeNE


$ diff doc_a doc_b
It only printed out the content of doc_a and doc_b. I have tried the options on --help

What I expect to have in the printout is;
Code:
Original    Mistake   Line No.   Word No.
this        thes      1          2
supported   suppurted 1          9
SANE        SeNE      1          11
not just printing out their contents and saying "differ"

B.R.
satimis
Reply With Quote
Reply

Tags
check, docaaa, docbbb, inconsistence, script

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump


Current GMT-time: 17:00 (Thursday, 23-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat