我有一個十列的數據列表,如下所示。它有幾千條線。按照一定的標準選擇行
$1 $2 $3 $4 $5 $6 $7 $8 $9 $10
| 8455 [email protected] | 8132 [email protected] 8131 [email protected] | 68.43
| 7490 [email protected] | 8868 [email protected] 8867 [email protected] | 68.30
| 7561 [email protected] | 9185 [email protected] 9184 [email protected] | 66.83
| 8776 [email protected] | 7481 [email protected] 7480 [email protected] | 65.55
| 8867 [email protected] | 8432 [email protected] 8431 [email protected] | 64.48
| 9832 [email protected] | 6357 [email protected] 6356 [email protected] | 64.44
| 9194 [email protected] | 5699 [email protected] 5698 [email protected] | 64.06
| 8849 [email protected] | 5780 [email protected] 5779 [email protected] | 63.99
我想選擇與某些特殊表達式匹配的列$ 3和列$ 6中的行。我希望用作正則表達式的標準是'前面的數字'@「符號在兩列中都是相同的。如果這個標準匹配,比我想要將這些行輸出到一個新文件。
我曾嘗試在AWK像這樣
awk '$3~/[[email protected]]/ {print $1,$2,$3,$4,$5,$6,$7,$8,$9,$10}' hhHB_inSameLayer_065_128-maltoLyo12per.tbl
,但它並沒有給我想要的東西。
我apreciate如果有人可以給一些幫助。
請注意:如果我在perl或python中獲得一些幫助,也感激不盡。
非常感謝提前。
前兩行實際上是否存在於文件中(帶'$ 1','$ 2' ...和空行的行),還是隻是爲了說明目的而將它放在那裏? – doubleDown
對於遲到的回覆很抱歉。實際上原文中只有幾行(大約8行文字)。 – Vijay
你好。你有沒有看到我的答案? – eyquem