daily pastebin goal
22%
SHARE
TWEET

Untitled

a guest Sep 14th, 2018 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. file_one = open('file1.txt', 'r')
  2. file_two = open('file2.txt', 'r')
  3.  
  4. content = file_one.readlines()
  5. content_2 = file_two.readlines()
  6.  
  7. non_match = []
  8.  
  9. for line in content:
  10.     for other_line in content_2:
  11.         if line != other_line and line not in non_match:
  12.             non_match.append(line)
  13.  
  14. print(('n').join(non_match))
  15.  
  16. file_one.close()
  17. file_two.close()
  18.    
  19. (xenial)vash@localhost:~$ python3.7 search.py
  20. neighbor 192.168.3.1 remote-as 200
  21.  
  22. neighbor 192.168.4.1 remote-as 300
  23.  
  24. neighbor 192.168.15.1 remote-as 400
  25.  
  26. neighbor 192.168.16.1 remote-as 500
  27.  
  28. neighbor 20.249.208.165 remote-as 200
  29.  
  30. neighbor 80.249.208.165 remote-as 100
  31.  
  32. neighbor 192.168.5.1 remote-as 400
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top