こんにちは、この質問を読んでいただきありがとうございます。最終日には私は問題を解決しようとしており、解決策に近づいていません。AWK:連続する行の一致する列を確認する
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
目標はもっとして1機の戦闘機を持っている持っている「トレーナー」を識別することです:私は、次が含まれているデータのサンプルファイルを持っています。私の直感は「getline」であり、AWKの変数宣言ディレクティブが必要になるでしょう。私はさまざまな組み合わせを試しました
awk [email protected] 'NR>1{a=$2; getline; if($2 = a) {print $0,"Yes"} else {print $0,"NO"}}' sample.txt
しかし、出力は希望の結果に近くありません。実際には、サンプルファイルのすべての行を出力しません。
私の望ましい結果は以下のとおりです。私は完全にここからどこへ行くにとして失われています
[email protected]
[email protected]@NO
[email protected]@NO
[email protected]@YES
[email protected]@YES
[email protected]@NO
[email protected]@NO
[email protected]@NO
[email protected]@NO
[email protected]@YES
[email protected]@YES
[email protected]@NO
[email protected]@NO
。私は検索して、役に立たない解決策を見つけようとしており、私はいくつかの情報を探しています。ありがとうございました!