import re testflight_file = './testflight_devices.txt' testflight_data = open(testflight_file).read() apple_file = './apple_devices.txt' # copy and paste from provisioning portal apple_data = open(apple_file).read() apple_uuids = re.findall('[a-z0-9]{30,50}',apple_data) for line in testflight_data.split("\n"): if not any(x in line for x in apple_uuids): print line