Subj : NodeDiff creation To : Jasen Betts From : Dan Egli Date : Wed Aug 13 2003 06:09 pm > Hi Dan. > 10-Aug-03 21:57:16, Dan Egli wrote to All > diff programs are fun :-% Tell me about it! >> I cannot figure out how to check out the reason for >> the delete and insert the propper delete reason in the diff > reason? Reason? For what? For having trouble figuring the delete setup? Here's two exaples of deletes: 1) Nodes 1:311/5, 6, 12, and 18 (all four next to each other in the nodelist) have dropped out. That's easy. Delete those 4 lines (D4). Figure it out by scanning the new file and seeing line N+1 (where N is the number of the last matching line) is the same as line N+5 in the old list. (N+5)-(N+1)=4, so D4. That's an easy example. This one is harder: Nodes 1:3005/3, and 4 (two nodes, one bbs) go temp down (Sysop warned he's on vacation and will fix things in a couple of weeks. Meanwhile his system has stopped responding. Rings and rings, no answer). Delete those two lines, but replace them with Down entries. I.e, assume the old entries looked like: ,3,My_Old_bbs,NOWhwere_US,Joe_Sysop,801-555-1212,CM,XA,v32b,v42b ,4,My_Old_bbs,NoWjhere_US,Joe_Sysop,000-000-000-000,CM,XX,INA:some.internet.dom ain.tld,IBN,IFC,ITN,IFT Now replace then with: Down,3,My_Old_bbs,NOWhwere_US,Joe_Sysop,801-555-1212,CM,XA,v32b,v42b Down,4,My_Old_bbs,NoWjhere_US,Joe_Sysop,000-000-000-000,CM,XX,INA:some.internet ..domain.tld,IBN,IFC,ITN,IFT Problem: the previous formula does't work. Here' N+3 in the old file is the same as N+3 in the new file. So, assuming P1 is the number of lines between old match and new match in the old file, and P2 is the number of lines between old match and new match in the new file, We'd get: (N+P1)-(N+P2)=0. So if we used that formula, the result would be along these lines in the new list: ,3,My_Old_bbs,NOWhwere_US,Joe_Sysop,801-555-1212,CM,XA,v32b,v42b ,4,My_Old_bbs,NoWjhere_US,Joe_Sysop,000-000-000-000,CM,XX,INA:some.internet.dom ain.tld,IBN,IFC,ITN,IFT Down,3,My_Old_bbs,NOWhwere_US,Joe_Sysop,801-555-1212,CM,XA,v32b,v42b Down,4,My_Old_bbs,NoWjhere_US,Joe_Sysop,000-000-000-000,CM,XX,INA:some.internet ..domain.tld,IBN,IFC,ITN,IFT The diff would show: C3 A2 Down,3,My_Old_bbs,NOWhwere_US,Joe_Sysop,801-555-1212,CM,XA,v32b,v42b Down,4,My_Old_bbs,NoWjhere_US,Joe_Sysop,000-000-000-000,CM,XX,INA:some.internet ..domain.tld,IBN,IFC,ITN,IFT ; continuing on That won't work. So I need some kind of algorythum for determining how many lines have CHANGED. Then I can generate this: C1 D2 A2 Down,3,My_Old_bbs,NOWhwere_US,Joe_Sysop,801-555-1212,CM,XA,v32b,v42b Down,4,My_Old_bbs,NoWjhere_US,Joe_Sysop,000-000-000-000,CM,XX,INA:some.internet ..domain.tld,IBN,IFC,ITN,IFT ; continuing on. Make sense? --- BBBS/LiI v4.01 Flag-5 * Origin: (1:3005/3) .