I want to match multiple strings from a file. How do I do this in python ?
Objective: match the lines which is having both values of "DC1" & "TIER2" from file
My code but give matches any string from strings object
strings = ["DC1","TIER2"]
with open(r"D:\kick-6.log", "r" ) as data:
for deltaa in data:
deltaa = data.readline().rstrip()
print ("*********")
for item in strings:
if item in deltaa:
print (deltaa)
deltaa = deltaa.rstrip()on the fourth line.