Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

(tye)Re2: Comparison Of Files

by tye (Sage)
on Dec 05, 2000 at 20:49 UTC ( [id://45016]=note: print w/replies, xml ) Need Help??


in reply to Re: Comparison Of Files
in thread Comparison Of Files

Two problems. First, you may need to sort both files before you do this. If the order of entries might change between days, then "diff" isn't a great solution.

Second, you'll probably end up printing severals lines as being both added and deleted. "diff" isn't great at doing a set difference. It is looking for document edits and so can easily report a big chunk of the "bigger" file as being changed and then show the subset of that chunk that was already there in the "smaller file" (and didn't change).

        - tye (but my friends call me "Tye")

Replies are listed 'Best First'.
Re: (tye)Re2: Comparison Of Files
by ImpalaSS (Monk) on Dec 05, 2000 at 20:54 UTC
    The 2 files are created from a directory listing of all the sites in the system, soi they will automatiicaly be sorted, in exactly the same order, however, new sites will be placed within that order. So the files could look like this:
    newsite1:
    PHI_R10K_2 PHI_TDAP_3 de0040Newark de0042Wilmington de0053Christana de0053Christiana de0101Odessa de0102Clayton de0103Dover de0180Claymont de0184Wooddale de0187Woodcreek de0205ChestnutKnoll de0267Chapman de0314Glasgow de0348Millside de0371SouthDover
    newsite2:
    PHI_R10K_2 PHI_TDAP_3 de0040Newark de0042Wilmington de0045Concord # <======= new site de0053Christana de0053Christiana de0101Odessa de0102Clayton de0103Dover de0180Claymont de0184Wooddale de0187Woodcreek de0205ChestnutKnoll de0267Chapman de0314Glasgow de0348Millside de0371SouthDover
    at which point i would want de0045concord returned.
    I hope this helps.
    Thanks again


    Dipul
Re: (tye)Re2: Comparison Of Files
by decnartne (Beadle) on Dec 05, 2000 at 20:54 UTC
    ouch! you're right... i did some further testing, and let's just say it's pretty ugly...

    decnartne ~ entranced

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://45016]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (6)
As of 2024-03-29 08:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found