awk处理字符串
文本内容:I am Kang,my qq is 345678
目的:只显示Kang 345678
方法1:
[root@localhost kang]# awk '{print $3,$NF}' test.txt
kang,my 4567864
[root@localhost kang]# awk '{print $3,$NF}' test.txt | sed 's#,my##g'
kang 4567864
方法2:
[root@localhost kang]# awk -F '[ ,]' '{print $3,$NF}' test.txt
kang 4567864