txt' which has lots of IP address in Lines as below
10.2.3.4
10.5.6.7
10.8.6.8
10.80.67.1
10.66.77.2
10.86.98.9
and another file b.txt
10.5.6.7
10.33.56.2
10.55.78.5
10.86.98.3
Now i want to write a code in python, so that b.txt IP is compare based on same on three octets with the IP address in a.txt file.
So that the output can be the one which is not in the a.txt, so the output will be below as this two IP address three octets don't match any in a.txt file
10.33.56.2
10.55.78.5
Thanks in advance.
file1 = open(r'a.txt', 'r')
file2 = open(r'b', 'r')
FO = open(r'c.txt', 'w')
data = file1.read()
my_list = data.splitlines('10.')
for i in my_list:
j = my_list[0:4]
print(j)