Difference between revisions of "Awk"

From Vague Hope Wiki
Jump to: navigation, search
 
Line 7: Line 7:
 
  awk '{sub(/\/$/, "") ; print $1}'
 
  awk '{sub(/\/$/, "") ; print $1}'
 
  awk '$12 > 3 {print $0}'
 
  awk '$12 > 3 {print $0}'
 +
awk '$11 == "-" && $12 > 1 {print $0}'

Latest revision as of 05:48, 15 February 2016

awk '{print $3}'
awk '{print $4 "|" $5}'
awk 'BEGIN { FS = "|" } ; { print $10 }'
awk '{total += $1; count++} END { print total/count } END {print count}'
awk '{printf "%s,%s\n", $1,$12}'
awk '{print ((substr($1,15,2) * 60) + substr($1,18,2)) "," $2}'
awk '{sub(/\/$/, "") ; print $1}'
awk '$12 > 3 {print $0}'
awk '$11 == "-" && $12 > 1 {print $0}'