Hi @gontajones, I tried your solution:
with open(file1.txt, "r") as f1: contents = f1.readlines() with open(output1.txt, "w+") as f2: for line in contents: if "wire" in line: if "input" in line: f2.write(line) elif "output" in line: f2.write(line) elif "result" in line: f2.write(line) else: if "input" in line: f2.write(line) elif "output" in line: f2.write(line) elif "result" in line: #remove "result" word only f2.write(line)However, its nt going thru the if "wire" in line, it goes straight to else statement. as it goes through else statement, it will print the result line without "result" word. Why it did not go through the if condition as it is true right?