如果这行包含" Iteration Continuity X-momentum Y-momentum Z-momentum Energy"这些字,那么删除这一行
时间: 2023-09-03 07:12:07 浏览: 107
删除文本重复行
好的,以下是删除这一行的Python代码示例:
```python
with open('file.txt', 'r') as f:
lines = f.readlines()
with open('file.txt', 'w') as f:
for line in lines:
if "Iteration Continuity X-momentum Y-momentum Z-momentum Energy" not in line:
f.write(line)
```
请将其中的`file.txt`替换为你所需操作的文件名。
阅读全文