jfz-2023-s474155/TaskD03/run.py

17 lines
379 B
Python
Raw Normal View History

2023-11-27 13:18:58 +01:00
import re
import sys
inFile = sys.argv[1]
outFile = sys.argv[2]
with open(inFile, 'r', encoding="utf-8") as sampleCheck, open(outFile, 'w', encoding='utf-8') as outputFile:
pattern = re.compile(r'19[0-9][0-9] r\.')
for line in sampleCheck:
match = re.search(pattern, line)
if match:
outputFile.write(line)
print(line, end='')