Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- file_one = open('file1.txt', 'r')
- file_two = open('file2.txt', 'r')
- content = file_one.readlines()
- content_2 = file_two.readlines()
- non_match = []
- for line in content:
- for other_line in content_2:
- if line != other_line and line not in non_match:
- non_match.append(line)
- print(('n').join(non_match))
- file_one.close()
- file_two.close()
- (xenial)vash@localhost:~$ python3.7 search.py
- neighbor 192.168.3.1 remote-as 200
- neighbor 192.168.4.1 remote-as 300
- neighbor 192.168.15.1 remote-as 400
- neighbor 192.168.16.1 remote-as 500
- neighbor 20.249.208.165 remote-as 200
- neighbor 80.249.208.165 remote-as 100
- neighbor 192.168.5.1 remote-as 400
Add Comment
Please, Sign In to add comment