using awk with column value conditions

前端 未结 6 499
甜味超标
甜味超标 2020-11-29 18:10

I\'m learning awk from The AWK Programming Language and I have a problem with one of the examples.

If I wanted to print $3 if $2 is equal to a value (e.g.1

6条回答
  •  南方客
    南方客 (楼主)
    2020-11-29 19:13

    This is more readable for me

    awk '{if ($2 ~ /findtext/) print $3}' 
    

提交回复
热议问题