大家好,
有一份文件(https://goo.gl/2Vc3Ui):
146460673
PING 10.0.0.6 (10.0.0.6): 56 data bytes
想要把146460673及56抓出來,
自己試過下列的regular expression:
cat short_measurement_PING.txt | sed -r 's/([0-9]+).*PING.*([0-9]+) data bytes/\1 \2/g'
cat short_measurement_PING.txt | sed -r 's/([0-9]+)$.*PING.*([0-9]+) data bytes/\1 \2/g'
cat short_measurement_PING.txt | sed -r 's/^([0-9]+)$^.*PING.*([0-9]+) data bytes/\1 \2/g'
不過完全沒作用,
想請問大家有什麼建議嗎?
謝謝~
※ 編輯: decken (212.201.78.21), 06/01/2016 06:10:26