【发布时间】:2014-11-18 17:19:21
【问题描述】:
我有一个文件 Batman.txt:
Batman lives in Gotham City.
In Gotham city batman is a vigilante
Gotham city has many criminals.
Batman and Joker live in Gotham city.
Superman and batman are very friendly, but batman is always prepared for
bad events unlike superman.
Superman lives in Metropolis city.
Batman has visited Metropolis city a couple of times.
我想将蝙蝠侠、哥谭和城市在同一行的行分开。那就是:
Batman lives in Gotham City.
In Gotham city batman is a vigilante
Batman and Joker live in Gotham city.
到目前为止,我有这个:
grep -E -i "batman|gotham|city" batman.txt
但它没有提供必要的输出。我得到了其他不需要的行。
输出是:
Batman lives in Gotham City.
In Gotham city batman is a vigilante
Gotham city has many criminals.
Batman and Joker live in Gotham city.
Superman and batman are very friendly, but batman is always prepared for
Superman lives in Metropolis city.
Batman has visited Metropolis city a couple of times.
请帮忙。 谢谢你
【问题讨论】: