Wednesday, February 24, 2021

search a pattern in file using Python

 import re

pattern = re.compile("ORA-")

for line in open("x2.txt"):

    for match in re.finditer(pattern, line):

        print(line)