I have a file that prints line by line if match
is in line, and if the string "Expected"
is in line. However, I want the line to start with match
instead of the actual beginning of the line.
This is the code I have
F = open(path,'r')
writestring = ''
for line in F:
if match in line:
if 'Expected' in line:
writestring = writestring+line+'\n'