Awk 将单词索引放在文本段落中每个单词的旁边

Awk 将单词索引放在文本段落中每个单词的旁边,awk,text,sed,grep,Awk,Text,Sed,Grep,是否有任何方法可以使用grep、sed或awk将每个单词的索引放在单词旁边(或者是否有内置此功能的软件) 例如,鉴于本文: "I love the power of Grep SED and AWK, but I am no good at using it" 我想要这个: "I(1) love(2) the(3) power(4) of(5) Grep(6) SED(7) and(8) AWK,(9) but(10) I(11) am(12) no(13) go

是否有任何方法可以使用grep、sed或awk将每个单词的索引放在单词旁边(或者是否有内置此功能的软件)

例如,鉴于本文:

"I love the power of Grep SED and AWK, but I am no good at using it"
我想要这个:

"I(1) love(2) the(3) power(4) of(5) Grep(6) SED(7) and(8) AWK,(9) but(10) I(11) am(12) no(13) good(14) at(15) using(16) it(17)"

对Clarify:
“我”
是第一个得到
“(1)”
“它”
是最后第17个单词得到
“(17)”
,不是计数而是索引号

$ echo "I ..."  | awk '{for(i=1;i<=NF;i++) $i=$i "(" ++c ")"}1'

I(1) love(2) the(3) power(4) of(5) Grep(6) SED(7) and(8) AWK,(9) but(10) I(11) am(12) no(13) good(14) at(15) using(16) it(17)

$echo“I…”awk'{for(I=1;我为什么在这里重新发布,是不是在biostars上的答案不清楚/不够?要关闭投票人,请重新考虑,发布足够清楚。