awk partly string match (if column/word partly matches)

前端 未结 5 1724
情深已故
情深已故 2020-12-12 14:40

My dummy file looks like this:

C1    C2    C3    
1     a     snow   
2     b     snowman 
snow     c     sowman

I want to get line if ther

5条回答
  •  北海茫月
    2020-12-12 15:15

    Print lines where the third field is either snow or snowman only:

    awk '$3~/^snow(man)?$/' file
    

提交回复
热议问题