Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- with open('group1', 'r') as file1:
- with open('group2', 'r') as file2:
- same = set(file1).difference(file2)
- same.discard('n')
- with open('some_output_file.txt', 'w') as file_out:
- for line in same:
- file_out.write(line)
- group1:
- test:x:1234:mike,john,scott
- test2:x:1234:mike,john
- test3:x:1234:tim,dustin,Alex
- group2:
- test:x:1234:mike,scott,john
- test2:x:1234:mike,john,scott
- test3:x:1234:dustin,tim
- missing group1:
- test2:scott
- missing group2:
- test3:Alex
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement