2016-07-06 65 views
0

我有幾個文件,看起來像這樣。我想按px數字排序 - 升序或降序查看具有最佳px值的文件。按字排序文件

8671 words (including </s>), 8671 decompounded words 
816 sentence(s), -llh=35158.3217 px=11342.3246, 323 oov (4.11%) 
1-gram hits: 5537 (63.86%) 
2-gram hits: 2859 (32.97%) 
3-gram hits: 258 (2.98%) 
4-gram hits: 17 (0.20%) 

有沒有辦法通過自己的像素數使用的排序條命令?(PX = 11342.3246)

+2

只有一個具有像素值線。你想排序**記錄**嗎? –

+0

我有幾個看起來像這樣的文件。我想按px數字排序 - 升序或降序查看具有最佳px值的文件。 – oezlem

+1

請更新您的問題。 –

回答

1

這是爲數不多的情況下,我會在一個流水線同時使用grepsed之一,因爲獲取文件名的保持是棘手的sed

grep px= my_files* | sed -r 's/([^:]+):.*px=([0-9.]+).*/\2 \1/' | sort -n