-3
我有一個任務來創建一個任務,該任務將獲取數據並將其放入日誌文件中。我有這個示例文本文件,它包含像這樣的塊/線。如何使用python替換文本文件中的碎塊
START OF SAMPLE
lines of sample
lines of sample
lines of sample
END OF SAMPLE
START OF SAMPLE
lines of sample
lines of sample
lines of sample
linSTART OF SAMPLE
lines of sample
lines of sample
lines of sample
START OF SAMPLE
lines of sample
lines of sample
lines of sample
END OF SAMPLE
正如你所看到的,還有就是樣品中破塊。我想找到與這樣的替換:
START OF SAMPLE
Corrupted SAMPLE
END OF SAMPLE
即使有樣品沒有END該塊,我想擁有它。