awk '$3 > 0 {printf("%s %.2f %.2f\n", $1, $2, $3)}' dataThe comparison $3 > 0 is to decide which field is to be selected.
The computation $2*$3 > 0 is to decide which field is to be selected.awk '$2*$3 > 50 {printf("$%.2f for %s\n", $2*$3, $1)}' data
as the following:$1 == "Susie"
awk '$1 == "Susie" {printf("%s %.2d %.2d\n", $1, $2, $3)}' data
and the program is as the following/Susie/
awk '/Susie/ {printf("%s %.2d %.2d\n", $1, $2, $3)}' data
select those lines where $2 is at least 4 or $3 is at least 20, the program can be given as:$2 >= 4 || $3 >= 20
awk '$2 >= 4 || $3 >= 20 {printf("%s %.2f %.2f\n", $1, $2, $3)}' data
评论