【发布时间】:2018-08-11 17:18:39
【问题描述】:
假设我有一个文本文件。我想使用 sed 替换文本文件中每第 n 次出现的字符串。如果我有一个字符串:
is this just real life or is this just fantasy or is it just me
对于每 3 次出现的 'is',替换为 'hat',将给出输出
is this just real life or is this just fantasy or hat it just me
我尝试使用其他 StackOverflow 问题中提供的答案,但没有一个可以替换所有问题。
【问题讨论】:
-
是的,抱歉,问题不清楚。