- 論壇徽章:
- 6
|
【Q2】
是我自己突發(fā)奇想,我也不知道能不能實現(xiàn)。
大意:第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
復(fù)制代碼【Q3】
字典是個什么樣的文件?如果我找到了應(yīng)該怎麼調(diào)用呢?
字典就是你要求的所有合法單詞的集合。
|
|