Compare two lists

John Allijn john.allijn.lc at gmail.com
Mon Sep 2 06:36:39 EDT 2013


An automated system sends me weekly reports with the following structure: 
Country,city,device_type,numer_of_devices
I'm working on an app that evaluates these reports and there is one thing I can't get done. 
I'd like to compare this weeks report with that of last week and report changes. 
Output could be something like this:
- UK-London - mobile - added 2 devices
- UAE - Dubai - new location - server - added 1
- FR - Paris - location removed - no more devices
- FR - Marseille - Location Added - mobile - 1 device added
- BE - brussels - no change


In my script I open both reports, copy the contents to two fields and with a loop I compare line by line of the two fields. 
This works well as long as only the numbers change. When locations, cities or countries are added or deleted, the number of lines of both fields don't match anymore and my script doesnt work anymore. 


There is potentially an unlimited number of countries, each with an unlimited number of cities that can be added or removed. I tried skipping a line and checking if that one matches with the next one in the other list, but obviously that didnt work. :(


Does anyone have an idea on how to approach this problem?



Thanks for any insights!!!
—
Sent from Mailbox for iPhone


More information about the use-livecode mailing list