awk 例子

awk [-F|-f|-v] ‘BEGIN{} //{command1; command2} END{}’ file

                                  匹配

input file R00,R01,R02,R03

output file a:R00,R01

output file b:R02,R03

awk -F, 'BEGIN{OFS=","} {if (NF<3) {print $0} else if(/R0[0-1]/){print $0}} '

 

 

 awk -F, '/4/ {print $0}'

awk -F, '$1~/4/ {print $0}'

posted @ 2017-04-19 17:27  白鸟li  阅读(153)  评论(0编辑  收藏  举报