- 论坛徽章:
- 6
|
【Q2】
是我自己突发奇想,我也不知道能不能实现。
大意:第n行是第m行的一部分,那么就保留m行,删除第n行 但是如何把:
in what I said! "Twaddle!", you say? I'll have you know
"Twaddle!", you say? I'll have you know
there's a deep truth
in what I said! there's a deep truth
变成:
"Twaddle!", you say? I'll have you know
in what I said! there's a deep truth
菜鸟表示完全没有思路、
"Twaddle!", you say? I'll have you know 怎么没有删除? 它不是in what I said! "Twaddle!", you say? I'll have you know的一部分吗?- $ awk '{a[NR]=$0;b[NR]=$0}END{for(i=1;i<=NR;i++)for(j=1;j<=NR;j++)if(i!=j && index(b[j],a[i])){delete a[i];break};for(i in a)print a[i]}' file
- in what I said! there's a deep truth
- in what I said! "Twaddle!", you say? I'll have you know
复制代码【Q3】
字典是个什么样的文件?如果我找到了应该怎麽调用呢?
字典就是你要求的所有合法单词的集合。
|
|