sort
処理できないと思われるファイルを処理する必要があります。ファイルは約です。それぞれ3GB。
入力は次のとおりです。
last-j nmod+j+n year-n 9492
last-j nmod+j+n night-n 8075
first-j nmod+j+n-the time-n 7749
same-j nmod+j+n-the time-n 7530
other-j nmod+j+n-the hand-n 5319
ast-j nmod+j+n year-n 1000
last-j nmod+j+n night-n 5000
first-j nmod+j+n-the time-n 1000
same-j nmod+j+n-the time-n 3000
other-j nmod+j+n-the hand-n 200
対応する重複の数を合計する必要があります。
したがって、望ましい出力は次のようになります。
last-j nmod+j+n year-n 10492
last-j nmod+j+n night-n 13075
first-j nmod+j+n-the time-n 8749
same-j nmod+j+n-the time-n 10530
other-j nmod+j+n-the hand-n 5519
私はこのソートコマンドを試してみましたが、これでうまくいくはずです
sort input | uniq -c | awk '{print $2 "\t" $3 "\t" $1*$4}'
そしてメモリ不足です。より大きなデータファイルを処理するために、もう少し最適化されている可能性のある何かについての提案はありますか?? ありがとう