我有一个包含多行文本的 txt 文件 (myText.txt)。
我想知道 :
- 如何创建需要删除的单词列表(我想自己设置单词)
- 如何创建需要替换的单词列表
例如,如果 myText.txt 是:
The ancient Romans influenced countries and civilizations in the following centuries.
Their language, Latin, became the basis for many other European languages. They stayed in Roma for 3 month.
- 我想删除“the”“and”“in” 我想用“old”替换“ancient”
- 我想用“年”代替“月”和“世纪”