Current location - Training Enrollment Network - Mathematics courses - Awk mathematical calculation
Awk mathematical calculation
awk? Start? { file 1 = " file 1 "; ? file2 = " file2? file3="file3}

$ 2 & gt=80? {? Print? & gt? file 1? }

60 & lt=$2? & amp& amp? $ 2 & lt80? {? Print? & gt? File 2? }

$2? & lt? 60? {? Print? & gt? File 3? }'? Archive or script:

#! /usr/bin/awk -f

BEGIN { file 1 = " file 1 "; file2 = " file2file3="file3}

$ 2 & gt= 80 { print & gtfile 1 }

60<= $2 & amp& amp$ 2 & lt80 {Print & gt file 2}

$2 & lt60 {print & gt file 3}