how to compare 2 very large textfiles
dick.kriesel at mail.com
Thu Oct 6 15:13:54 CDT 2011
On Oct 5, 2011, at 3:00 PM, Matthias Rebbe wrote:
> i need to compare two very large text files with about 5000 - 7000 lines each with a lines size of up to 256 chars.
> I need to find out if there are lines missing in either file a or file b.
> What is the best way to do this with good speed?
Hi, Matthias. Here's another contender:
repeat for each line tLine in tList1
put empty into tArray1[ tLine ]
repeat for each line tLine in tList2
if tLine is not among the keys of tArray1 then
put empty into tArray2[ tLine ]
delete variable tArray1[ tLine ]
put the keys of tArray1 into tList1ButNotList2
put the keys of tArray2 into tList2ButNotList1
Please do share the results of your speed comparisons.
More information about the use-livecode