Aug-21-2021, 06:36 AM
Here you go.
I'm using a file and a list.
File:
I'm using a file and a list.
File:
ZPM911 ZPM1912 ZPM1919 ZPM4555 ZPM4556 ZPM4557Snippet:
ff=open("c:/02/TTST.txt",'r') list_1=ff.readlines() list_2 = ['ZPM911,UP,DOWN','ZPM1912,UP,UP','ZPM1919,DOWN,DOWN'] for el in list_1 : el=el.strip() for ehl in list_2 : ehl=ehl.strip() sp0,*stuff = ehl.split(",") if el == sp0 : print(f" Matched ++++++ {el}") else : print(f" Not Matched -- {el}") ff.close()