# cat temp.txt
abc www 3201 3/13/11 30138
Dpf gro 3033 2/32/13 02901
xyz dai 3010 8/81/11 10391
opf lio 8901 7/18/38 31899
# awk '{print $3, $2}' temp.txt
3201 www
3033 gro
3010 dai
8901 lio
# awk '{OFS = "---"; print $3, $2}' temp.txt
3201---www
3033---gro
3010---dai
8901---lio
# awk '{print $3 $2}' temp.txt
3201www
3033gro
3010dai
8901lio
# awk '{print "Number of fields: "NF}' temp.txt
Number of fields: 5
Number of fields: 5
Number of fields: 5
Number of fields: 5
# awk '{print "Number of fields: "NF; print $NF}' temp.txt
Number of fields: 5
30138
Number of fields: 5
02901
Number of fields: 5
10391
Number of fields: 5
31899
Groad 123
sIna 100
SoHu 121
Baidu 111
# awk '{IGNORECASE=1}; $1 == "groad" {print NR, $1, $2}' domain.txt
1 Groad 123
欢迎光临 曲径通幽论坛 (http://www.groad.net/bbs/) | Powered by Discuz! X3.2 |